public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39333]  New: gcc 4.3.3 miscompiles when -finline-small-functions is used
@ 2009-03-01 18:18 galtgendo at o2 dot pl
  2009-03-01 18:20 ` [Bug c/39333] " galtgendo at o2 dot pl
                   ` (22 more replies)
  0 siblings, 23 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-01 18:18 UTC (permalink / raw)
  To: gcc-bugs

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.3
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--disable-fixed-point --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror --enable-secureplt
--disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp
--enable-cld --disable-libgcj --with-arch=i686 --enable-objc-gc
--enable-languages=c,c++,objc,treelang,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.3 p1.0,
pie-10.1.5'
Thread model: posix
gcc version 4.3.3 (Gentoo 4.3.3 p1.0, pie-10.1.5) 
COLLECT_GCC_OPTIONS='-DHAVE_CONFIG_H' '-I.' '-I.' '-I../..' '-I../../utility'
'-I..' '-I../../common' '-I../../intl' '-DLOCALEDIR="/usr/share/locale"'
'-DDEFAULT_DATA_PATH=".:data:~/.freeciv:/usr/share/games/freeciv"' '-Wall'
'-Wpointer-arith' '-Wcast-align' '-Wmissing-prototypes'
'-Wmissing-declarations' '-O2' '-march=athlon' '-mtune=athlon' '-pipe' '-c'
'-save-temps' '-v'
 /usr/libexec/gcc/i686-pc-linux-gnu/4.3.3/cc1 -E -quiet -v -I. -I. -I../..
-I../../utility -I.. -I../../common -I../../intl -DHAVE_CONFIG_H
-DLOCALEDIR="/usr/share/locale"
-DDEFAULT_DATA_PATH=".:data:~/.freeciv:/usr/share/games/freeciv" cm.c
-D_FORTIFY_SOURCE=2 -march=athlon -mtune=athlon -Wall -Wpointer-arith
-Wcast-align -Wmissing-prototypes -Wmissing-declarations -O2 -fpch-preprocess
-o cm.i
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory "."
ignoring duplicate directory "../../common"
#include "..." search starts here:
#include <...> search starts here:
 .
 ../..
 ../../utility
 ..
 ../../intl
 /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include
 /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-DHAVE_CONFIG_H' '-I.' '-I.' '-I../..' '-I../../utility'
'-I..' '-I../../common' '-I../../intl' '-DLOCALEDIR="/usr/share/locale"'
'-DDEFAULT_DATA_PATH=".:data:~/.freeciv:/usr/share/games/freeciv"' '-Wall'
'-Wpointer-arith' '-Wcast-align' '-Wmissing-prototypes'
'-Wmissing-declarations' '-O2' '-march=athlon' '-mtune=athlon' '-pipe' '-c'
'-save-temps' '-v'
 /usr/libexec/gcc/i686-pc-linux-gnu/4.3.3/cc1 -fpreprocessed cm.i -quiet
-dumpbase cm.c -march=athlon -mtune=athlon -auxbase cm -O2 -Wall
-Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations
-version -o cm.s
GNU C (Gentoo 4.3.3 p1.0, pie-10.1.5) version 4.3.3 (i686-pc-linux-gnu)
        compiled by GNU C version 4.3.3, GMP version 4.2.4, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64090
Compiler executable checksum: 3bb01a6c568a839db7333dbf97a76459
COLLECT_GCC_OPTIONS='-DHAVE_CONFIG_H' '-I.' '-I.' '-I../..' '-I../../utility'
'-I..' '-I../../common' '-I../../intl' '-DLOCALEDIR="/usr/share/locale"'
'-DDEFAULT_DATA_PATH=".:data:~/.freeciv:/usr/share/games/freeciv"' '-Wall'
'-Wpointer-arith' '-Wcast-align' '-Wmissing-prototypes'
'-Wmissing-declarations' '-O2' '-march=athlon' '-mtune=athlon' '-pipe' '-c'
'-save-temps' '-v'
 /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/as -V
-Qy -o cm.o cm.s
GNU assembler version 2.19 (i686-pc-linux-gnu) using BFD version (GNU Binutils)
2.19
COMPILER_PATH=/usr/libexec/gcc/i686-pc-linux-gnu/4.3.3/:/usr/libexec/gcc/i686-pc-linux-gnu/4.3.3/:/usr/libexec/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/libexec/gcc/i686-pc-linux-gnu/4.3.3/:/usr/libexec/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/lib/:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-DHAVE_CONFIG_H' '-I.' '-I.' '-I../..' '-I../../utility'
'-I..' '-I../../common' '-I../../intl' '-DLOCALEDIR="/usr/share/locale"'
'-DDEFAULT_DATA_PATH=".:data:~/.freeciv:/usr/share/games/freeciv"' '-Wall'
'-Wpointer-arith' '-Wcast-align' '-Wmissing-prototypes'
'-Wmissing-declarations' '-O2' '-march=athlon' '-mtune=athlon' '-pipe' '-c'
'-save-temps' '-v'

Now, I'm not sure, whether this file is the correct one, as freeciv is quite
big, but http://bugs.freeciv.org/Ticket/Display.html?id=40610 seems to suggest
that this is the correct one.
I'm not sure, whether or not upstream has opened a bug here already, as I'm not
sure,
what search terms should I use.


-- 
           Summary: gcc 4.3.3 miscompiles when -finline-small-functions is
                    used
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: galtgendo at o2 dot pl


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
@ 2009-03-01 18:20 ` galtgendo at o2 dot pl
  2009-03-02 13:52 ` [Bug middle-end/39333] " pinskia at gcc dot gnu dot org
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-01 18:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from galtgendo at o2 dot pl  2009-03-01 18:19 -------
Created an attachment (id=17381)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17381&action=view)
preprocessed file


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
  2009-03-01 18:20 ` [Bug c/39333] " galtgendo at o2 dot pl
@ 2009-03-02 13:52 ` pinskia at gcc dot gnu dot org
  2009-03-02 21:56 ` galtgendo at o2 dot pl
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-02 13:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2009-03-02 13:52 -------
Does -fno-strict-aliasing help ?
Does -fno-strict-overflow help?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
  2009-03-01 18:20 ` [Bug c/39333] " galtgendo at o2 dot pl
  2009-03-02 13:52 ` [Bug middle-end/39333] " pinskia at gcc dot gnu dot org
@ 2009-03-02 21:56 ` galtgendo at o2 dot pl
  2009-03-02 22:20 ` galtgendo at o2 dot pl
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-02 21:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from galtgendo at o2 dot pl  2009-03-02 21:56 -------
I'll check, but, as summary suggests (indirectly),
'-O2 -fno-inline-small-functions' works just fine.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (2 preceding siblings ...)
  2009-03-02 21:56 ` galtgendo at o2 dot pl
@ 2009-03-02 22:20 ` galtgendo at o2 dot pl
  2009-03-02 22:43 ` pinskia at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-02 22:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from galtgendo at o2 dot pl  2009-03-02 22:20 -------
Well, neither helps.
As a sidenote: 'gcc -Q -O2 --help=optimizers' fails to list
'-fstrict-overflow',


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (3 preceding siblings ...)
  2009-03-02 22:20 ` galtgendo at o2 dot pl
@ 2009-03-02 22:43 ` pinskia at gcc dot gnu dot org
  2009-03-03  0:20 ` galtgendo at o2 dot pl
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-02 22:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2009-03-02 22:43 -------
(In reply to comment #3)
> I'll check, but, as summary suggests (indirectly),
> '-O2 -fno-inline-small-functions' works just fine.

But that just enables more inlining.  The problem is most likely somewhere
else.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (4 preceding siblings ...)
  2009-03-02 22:43 ` pinskia at gcc dot gnu dot org
@ 2009-03-03  0:20 ` galtgendo at o2 dot pl
  2009-03-03  0:21 ` pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03  0:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from galtgendo at o2 dot pl  2009-03-03 00:20 -------
(In reply to comment #5)
> But that just enables more inlining.  The problem is most likely somewhere
> else.
> 
If so, why does '-O2' fail and '-O2 -fno-inline-small-functions' work ?


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (5 preceding siblings ...)
  2009-03-03  0:20 ` galtgendo at o2 dot pl
@ 2009-03-03  0:21 ` pinskia at gcc dot gnu dot org
  2009-03-03  3:23 ` galtgendo at o2 dot pl
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-03  0:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2009-03-03 00:21 -------
(In reply to comment #6)
> If so, why does '-O2' fail and '-O2 -fno-inline-small-functions' work ?

Because you just disabled some extra inlining.  try -O2
-fno-inline-small-functions -finline-functions and you will see that it still
fails.

-- Pinski


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (6 preceding siblings ...)
  2009-03-03  0:21 ` pinskia at gcc dot gnu dot org
@ 2009-03-03  3:23 ` galtgendo at o2 dot pl
  2009-03-03  3:43 ` galtgendo at o2 dot pl
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03  3:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from galtgendo at o2 dot pl  2009-03-03 03:23 -------
OK, we seem to misunderstand each other.

Anyway, as '-Wall -Wpointer-arith
-Wcast-align -Wmissing-prototypes -Wmissing-declarations'
was set for all files during build and there were no warnings,
the problem is probably non-trivial (though seeing just how
much inlining is used is this file, I wouldn't be surprised,
if it's 50/50 on gcc/freeciv).
When I added '-Wextra', most of the new warnings were of either
'unused argument' or 'signed/unsinged comparison' type - in this
file, there were no other.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (7 preceding siblings ...)
  2009-03-03  3:23 ` galtgendo at o2 dot pl
@ 2009-03-03  3:43 ` galtgendo at o2 dot pl
  2009-03-03  3:51 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03  3:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from galtgendo at o2 dot pl  2009-03-03 03:43 -------
BTW, this is the workaround, that upstream created:
http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/cm.c?rev=15556&view=diff&r1=15556&r2=15555&p1=trunk/common/aicore/cm.c&p2=/trunk/common/aicore/cm.c


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (8 preceding siblings ...)
  2009-03-03  3:43 ` galtgendo at o2 dot pl
@ 2009-03-03  3:51 ` pinskia at gcc dot gnu dot org
  2009-03-03 15:15 ` galtgendo at o2 dot pl
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-03  3:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2009-03-03 03:51 -------
   for (i = 0, j = 0; i < lattice->size || forced_loop; i++) {


i is signed and lattice->size is unsigned so there might be some wrapping.  

plus  if (lattice->size > 0) { 
will be changed into   lattice->size != 0 .


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (9 preceding siblings ...)
  2009-03-03  3:51 ` pinskia at gcc dot gnu dot org
@ 2009-03-03 15:15 ` galtgendo at o2 dot pl
  2009-03-03 16:17 ` galtgendo at o2 dot pl
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03 15:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from galtgendo at o2 dot pl  2009-03-03 15:15 -------
Changing those two to unsigned doesn't help (I have checked that
even before comment 8). Actually, I changed a few ints to unsigned
wherever it looked sane for this file and it still crashed.

What's more, '-O1' works and when I decided to go down the man page
and test by -fno-* all of the features listed as additionally
turned on by -O2
(-fthread-jumps -falign-functions  -falign-jumps -falign-loops  -falign-labels
-fcaller-saves -fcrossjumping -fcse-follow-jumps  -fcse-skip-blocks
-fdelete-null-pointer-checks -fexpensive-optimizations -fgcse
-fgcse-lm -foptimize-sibling-calls -fpeephole2 -fregmove
-freorder-blocks  -freorder-functions -frerun-cse-after-loop
-fsched-interblock  -fsched-spec -fschedule-insns
-fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-pre
-ftree-vrp) neither of them worked on its own.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (10 preceding siblings ...)
  2009-03-03 15:15 ` galtgendo at o2 dot pl
@ 2009-03-03 16:17 ` galtgendo at o2 dot pl
  2009-03-03 16:22 ` galtgendo at o2 dot pl
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from galtgendo at o2 dot pl  2009-03-03 16:17 -------
OK, a (perhaps) interesting result:
'-fno-guess-branch-probability' works too, but
as first to work was '-fno-inline-small-functions',
this may simply be a case of this option making code
big enough to hit inlining limit.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (11 preceding siblings ...)
  2009-03-03 16:17 ` galtgendo at o2 dot pl
@ 2009-03-03 16:22 ` galtgendo at o2 dot pl
  2009-03-03 17:01 ` hjl dot tools at gmail dot com
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from galtgendo at o2 dot pl  2009-03-03 16:22 -------
On a not really related note:
output of 'gcc -Q -O1 --help=optimizers' is quite inconsistent
with the manpage. Among others, -finline-small-functions according
to the manpage is turned on for -O1, -Q output claims the opposite.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (12 preceding siblings ...)
  2009-03-03 16:22 ` galtgendo at o2 dot pl
@ 2009-03-03 17:01 ` hjl dot tools at gmail dot com
  2009-03-03 21:13 ` galtgendo at o2 dot pl
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-03-03 17:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from hjl dot tools at gmail dot com  2009-03-03 17:01 -------
Is there a testcase to show run-time error or compile-time error?


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (13 preceding siblings ...)
  2009-03-03 17:01 ` hjl dot tools at gmail dot com
@ 2009-03-03 21:13 ` galtgendo at o2 dot pl
  2009-03-07  4:30 ` galtgendo at o2 dot pl
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-03 21:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from galtgendo at o2 dot pl  2009-03-03 21:13 -------
It's a runtime error and there's no real testcase,
as, for the time being, it's hard to say what exactly goes wrong.

The only real analysis is in the upstream bug, but it's nothing conclusive
(at least it doesn't seem that way).


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (14 preceding siblings ...)
  2009-03-03 21:13 ` galtgendo at o2 dot pl
@ 2009-03-07  4:30 ` galtgendo at o2 dot pl
  2009-03-07  4:35   ` Andrew Thomas Pinski
  2009-03-07  4:36 ` pinskia at gmail dot com
                   ` (6 subsequent siblings)
  22 siblings, 1 reply; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-07  4:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from galtgendo at o2 dot pl  2009-03-07 04:30 -------
OK, I've done a little test and I'd like to know,
if it's results actually mean anything:
I've compiled freeciv with CFLAGS="-O2 -finline-functions
-fno-guess-branch-probability" and it did not crash.

Does the above confirm that the problem lies in -fguess-branch-probability ?


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-07  4:30 ` galtgendo at o2 dot pl
@ 2009-03-07  4:35   ` Andrew Thomas Pinski
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Thomas Pinski @ 2009-03-07  4:35 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs



Sent from my iPhone

On Mar 6, 2009, at 8:30 PM, "galtgendo at o2 dot pl" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

>
>
> ------- Comment #16 from galtgendo at o2 dot pl  2009-03-07 04:30  
> -------
> OK, I've done a little test and I'd like to know,
> if it's results actually mean anything:
> I've compiled freeciv with CFLAGS="-O2 -finline-functions
> -fno-guess-branch-probability" and it did not crash.
>
> Does the above confirm that the problem lies in -fguess-branch- 
> probability ?

Not really because that option only generates information used by  
other optimazations.

>
>
>
> -- 
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
>


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (15 preceding siblings ...)
  2009-03-07  4:30 ` galtgendo at o2 dot pl
@ 2009-03-07  4:36 ` pinskia at gmail dot com
  2009-03-07 14:06 ` galtgendo at o2 dot pl
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: pinskia at gmail dot com @ 2009-03-07  4:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from pinskia at gmail dot com  2009-03-07 04:35 -------
Subject: Re:  gcc 4.3.3 miscompiles when -finline-small-functions is used



Sent from my iPhone

On Mar 6, 2009, at 8:30 PM, "galtgendo at o2 dot pl" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

>
>
> ------- Comment #16 from galtgendo at o2 dot pl  2009-03-07 04:30  
> -------
> OK, I've done a little test and I'd like to know,
> if it's results actually mean anything:
> I've compiled freeciv with CFLAGS="-O2 -finline-functions
> -fno-guess-branch-probability" and it did not crash.
>
> Does the above confirm that the problem lies in -fguess-branch- 
> probability ?

Not really because that option only generates information used by  
other optimazations.

>
>
>
> -- 
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
>


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (16 preceding siblings ...)
  2009-03-07  4:36 ` pinskia at gmail dot com
@ 2009-03-07 14:06 ` galtgendo at o2 dot pl
  2009-03-16 10:24 ` falk at debian dot org
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-03-07 14:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from galtgendo at o2 dot pl  2009-03-07 14:06 -------
Well, I've got bad news for you anyway:
it seems that the problem affects gcc-4.3.2 too:
it seems it's reproducible in another app,
however one potentially much harder to debug.
Please read http://bugs.winehq.org/show_bug.cgi?id=17406
and give some ideas for a test.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (17 preceding siblings ...)
  2009-03-07 14:06 ` galtgendo at o2 dot pl
@ 2009-03-16 10:24 ` falk at debian dot org
  2009-04-22  0:04 ` galtgendo at o2 dot pl
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: falk at debian dot org @ 2009-03-16 10:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from falk at debian dot org  2009-03-16 10:24 -------
(In reply to comment #18)
> Well, I've got bad news for you anyway:
> it seems that the problem affects gcc-4.3.2 too:
> it seems it's reproducible in another app,
> however one potentially much harder to debug.
> Please read http://bugs.winehq.org/show_bug.cgi?id=17406
> and give some ideas for a test.

The fact that -fno-inline helps gives only very little indication that this is
actually the same problem.

In any case, I don't think there's really anything we can do without a complete
test case (that is, a single file with a main() that exits with 0 when
everything's fine and 1 otherwise). This is very difficult to do for someone
who doesn't know the freeciv codebase.


-- 

falk at debian dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (18 preceding siblings ...)
  2009-03-16 10:24 ` falk at debian dot org
@ 2009-04-22  0:04 ` galtgendo at o2 dot pl
  2009-04-22  0:23 ` galtgendo at o2 dot pl
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-04-22  0:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from galtgendo at o2 dot pl  2009-04-22 00:04 -------
Created an attachment (id=17669)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17669&action=view)
prepocessed source of id.c

People, I've got a result, that's either very funny or very not funny.
With the same compiler, with the command "i686-pc-linux-gnu-gcc -std=gnu99 -O2
-march=athlon -mtune=athlon -pipe -fno-guess-branch-probability -I../lib -o id
id.c group-list.o libver.a ../lib/libcoreutils.a"
id.c from coreutils 7.2 gets miscompiled, resulting in "id -u" always printing
"id: cannot print "only" of more than one choice"
The "funny" part is that without "-fno-guess-branch-probability" it works
correctly, so it's the (sort of) opposite of above.
I will shortly test, if things change with gcc 4.4.0.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (19 preceding siblings ...)
  2009-04-22  0:04 ` galtgendo at o2 dot pl
@ 2009-04-22  0:23 ` galtgendo at o2 dot pl
  2009-04-22  1:08 ` galtgendo at o2 dot pl
  2009-04-22  1:15 ` galtgendo at o2 dot pl
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-04-22  0:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from galtgendo at o2 dot pl  2009-04-22 00:23 -------
Well, with 4.4.0 id.c compiles correctly in both cases.
Let's check the harder part.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (20 preceding siblings ...)
  2009-04-22  0:23 ` galtgendo at o2 dot pl
@ 2009-04-22  1:08 ` galtgendo at o2 dot pl
  2009-04-22  1:15 ` galtgendo at o2 dot pl
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-04-22  1:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from galtgendo at o2 dot pl  2009-04-22 01:08 -------
Well, gcc 4.4.0 works without '-fno-inline-small-functions' for
freeciv too.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug middle-end/39333] gcc 4.3.3 miscompiles when -finline-small-functions is used
  2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
                   ` (21 preceding siblings ...)
  2009-04-22  1:08 ` galtgendo at o2 dot pl
@ 2009-04-22  1:15 ` galtgendo at o2 dot pl
  22 siblings, 0 replies; 25+ messages in thread
From: galtgendo at o2 dot pl @ 2009-04-22  1:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from galtgendo at o2 dot pl  2009-04-22 01:15 -------
comment 22 was of course about '-fno-guess-branch-probability',
not the other one.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2009-04-22  1:15 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-01 18:18 [Bug c/39333] New: gcc 4.3.3 miscompiles when -finline-small-functions is used galtgendo at o2 dot pl
2009-03-01 18:20 ` [Bug c/39333] " galtgendo at o2 dot pl
2009-03-02 13:52 ` [Bug middle-end/39333] " pinskia at gcc dot gnu dot org
2009-03-02 21:56 ` galtgendo at o2 dot pl
2009-03-02 22:20 ` galtgendo at o2 dot pl
2009-03-02 22:43 ` pinskia at gcc dot gnu dot org
2009-03-03  0:20 ` galtgendo at o2 dot pl
2009-03-03  0:21 ` pinskia at gcc dot gnu dot org
2009-03-03  3:23 ` galtgendo at o2 dot pl
2009-03-03  3:43 ` galtgendo at o2 dot pl
2009-03-03  3:51 ` pinskia at gcc dot gnu dot org
2009-03-03 15:15 ` galtgendo at o2 dot pl
2009-03-03 16:17 ` galtgendo at o2 dot pl
2009-03-03 16:22 ` galtgendo at o2 dot pl
2009-03-03 17:01 ` hjl dot tools at gmail dot com
2009-03-03 21:13 ` galtgendo at o2 dot pl
2009-03-07  4:30 ` galtgendo at o2 dot pl
2009-03-07  4:35   ` Andrew Thomas Pinski
2009-03-07  4:36 ` pinskia at gmail dot com
2009-03-07 14:06 ` galtgendo at o2 dot pl
2009-03-16 10:24 ` falk at debian dot org
2009-04-22  0:04 ` galtgendo at o2 dot pl
2009-04-22  0:23 ` galtgendo at o2 dot pl
2009-04-22  1:08 ` galtgendo at o2 dot pl
2009-04-22  1:15 ` galtgendo at o2 dot pl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).