[Bug c/42231] New: [4.4.x Regression] Wrong generated code when using a callback function (possible callback function inlining bug ?)

2009-11-30 Thread roche+gccbugs at exalead dot com
Bug reproduced with GCC 4.4.2 and GCC 4.4.1, on x86_64.

The following simple test program should succeed (EXIT_SUCCESS return code from
main()), but fails with GCC 4.4.2 when compiling with -O3.

The program succeed with "-O2", _AND_ "-O2 -finline-functions -funswitch-loops
-fpredictive-commoning -fgcse-after-reload -ftree-vectorize" (which is supposed
to be the same as -O3, according to the manual, but there must be some
additional optimization out there)

The problem might be related to some inlining magic of the callback function,
because
* if you remove the "&& !fun(0);" in the CallFunction() function, the program
works again.
* if you change the function arguments "int depth" into "const int depth", the
program works again
* when the program works (for example, by adding "const" to the function
arguments), the callback function "callback" is NOT inlined


-- 
   Summary: [4.4.x Regression] Wrong generated code when using a
callback function (possible callback function inlining
bug ?)
   Product: gcc
   Version: 4.4.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
    AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: roche+gccbugs at exalead dot com
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42231



[Bug c/42231] [4.4.x Regression] Wrong generated code when using a callback function (possible callback function inlining bug ?)

2009-11-30 Thread roche+gccbugs at exalead dot com


--- Comment #1 from roche+gccbugs at exalead dot com  2009-11-30 14:29 
---
Created an attachment (id=19188)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19188&action=view)
The test program (exit code is meaningful)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42231



[Bug c/42231] [4.4.x Regression] Wrong generated code when using a callback function (possible callback function inlining bug ?)

2009-11-30 Thread roche+gccbugs at exalead dot com


--- Comment #2 from roche+gccbugs at exalead dot com  2009-11-30 14:38 
---
Created an attachment (id=19189)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19189&action=view)
The preprocessor version


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42231



[Bug c/42231] [4.4.x Regression] Wrong generated code when using a callback function (possible callback function inlining bug ?)

2009-11-30 Thread roche+gccbugs at exalead dot com


--- Comment #3 from roche+gccbugs at exalead dot com  2009-11-30 14:38 
---
Created an attachment (id=19190)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19190&action=view)
The assembly source version


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42231



[Bug tree-optimization/42231] [4.4 Regression] Wrong generated code when using a callback function (possible callback function inlining bug ?)

2009-11-30 Thread roche+gccbugs at exalead dot com


--- Comment #5 from roche+gccbugs at exalead dot com  2009-11-30 15:06 
---
Just a small note: also work with "just" -fno-ipa-cp-clone in O3 mode,
actually. Therefore the issue is probably related to the "Perform function
cloning to make interprocedural constant propagation stronger" feature
introduced in -O3 optimization.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42231



[Bug c/42724] New: Trivial uninitialized variable not spotted

2010-01-13 Thread roche+gccbugs at exalead dot com
Possibly related to BUG 39799

The attached very simple test case does not produce any warning on build, using
'-W -Wall -Wextra -O3 -Wuninitialized -Werror'.

If the condition is not seen as false at build time, the compiler does not
complaint.


-- 
   Summary: Trivial uninitialized variable not spotted
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: roche+gccbugs at exalead dot com
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42724



[Bug c/42724] Trivial uninitialized variable not spotted

2010-01-13 Thread roche+gccbugs at exalead dot com


--- Comment #1 from roche+gccbugs at exalead dot com  2010-01-13 13:14 
---
Created an attachment (id=19570)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19570&action=view)
Test case that should produce a warning with -O -Wuninitialized


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42724