-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove redundant leftmost decl from closure
In the following case: ``` static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; ``` we need to remove `stbi__h2l_gamma_i` from the closure else it will output ``` static float stbi__h2l_gamma_i=1.0f/2.2f; static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; ``` which is a redeclaration fo the first variable. Signed-off-by: Giuliano Belinassi <[email protected]>
- Loading branch information
1 parent
b4c013b
commit 57e013e
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_NO_EXTERNALIZATION" }*/ | ||
|
||
extern double pow (double __x, double __y) __attribute__ ((__nothrow__ )); | ||
extern double __pow (double __x, double __y) __attribute__ ((__nothrow__ )); | ||
|
||
static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; | ||
|
||
void f() { | ||
float z = (float) pow(stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump "static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;" } } */ | ||
/* { dg-final { scan-tree-dump-not "static float stbi__h2l_gamma_i=1.0f/2.2f;" } } */ |