public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/33638]  New: optimization bug: wrong code with -fforce-addr
@ 2007-10-03 12:44 manfred99 at gmx dot ch
  2007-10-03 12:46 ` [Bug middle-end/33638] " manfred99 at gmx dot ch
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: manfred99 at gmx dot ch @ 2007-10-03 12:44 UTC (permalink / raw)
  To: gcc-bugs

I have a rather nasty optimization issue with gfortran (as of yesterday). 
As I think it could be an optimization issue and not an gfortran frontend
issue, so I assigned it to the middle-end.

I narrowed my problem to one single fortran function. If I compile this
function with
"gfortran -O2 -march=pentium4" the output is OK, using
"gfortran -O2 -march=pentium4 -fforce-addr" produces wrong output.

When reducing optimization level to "-O1", the issue vanishes for all tried
flag combinations.
If I comment out a particular non-functional line in this code, the issue goes
away:

if (always_true) then
  ....
else
   this_line_commented_out_makes_it_working_again
   ....
endif

I will add assembler output of original, non-working code as well as
of working code when commenting the non-functional line, both compiled with
"gfortran -O2 -march=pentium4 -fforce-addr -S comunpack.f"
Function code is added as well.


Further data points:
- output of -fdump-tree-optimized is the same for both the working and the 
    broken case (of the original function, not the line commenting test).
- there are differences in assembler output though.
- the code calls C functions.
- I could reproduce this issue on an different, non-pentium4 machine 
    using the same flags.
- the flag -march=pentium4 is necessary to trigger the issue.


-- 
           Summary: optimization bug: wrong code with -fforce-addr
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manfred99 at gmx dot ch


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


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

end of thread, other threads:[~2007-10-12 15:28 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-03 12:44 [Bug middle-end/33638] New: optimization bug: wrong code with -fforce-addr manfred99 at gmx dot ch
2007-10-03 12:46 ` [Bug middle-end/33638] " manfred99 at gmx dot ch
2007-10-03 12:47 ` manfred99 at gmx dot ch
2007-10-03 12:49 ` manfred99 at gmx dot ch
2007-10-03 15:43 ` ubizjak at gmail dot com
2007-10-03 20:11 ` manfred99 at gmx dot ch
2007-10-04  6:48 ` ubizjak at gmail dot com
2007-10-05  9:36 ` manfred99 at gmx dot ch
2007-10-05  9:39 ` manfred99 at gmx dot ch
2007-10-05 10:47 ` [Bug rtl-optimization/33638] [4.3 regression]: " ubizjak at gmail dot com
2007-10-05 11:40 ` ubizjak at gmail dot com
2007-10-05 11:50 ` zadeck at naturalbridge dot com
2007-10-05 12:36 ` rguenth at gcc dot gnu dot org
2007-10-05 13:03 ` zadeck at naturalbridge dot com
2007-10-05 17:50 ` kargl at gcc dot gnu dot org
2007-10-05 20:16 ` rguenth at gcc dot gnu dot org
2007-10-05 20:17 ` zadeck at naturalbridge dot com
2007-10-06  6:49 ` ubizjak at gmail dot com
2007-10-06 12:27 ` zadeck at naturalbridge dot com
2007-10-06 13:07 ` zadeck at naturalbridge dot com
2007-10-06 19:59 ` ubizjak at gmail dot com
2007-10-06 21:20 ` zadeck at naturalbridge dot com
2007-10-08  8:56 ` ubizjak at gmail dot com
2007-10-08 12:16 ` ubizjak at gmail dot com
2007-10-08 12:35 ` Kenneth dot Zadeck at NaturalBridge dot com
2007-10-11  5:33 ` ebotcazou at gcc dot gnu dot org
2007-10-11  5:39 ` [Bug rtl-optimization/33638] [4.3 regression] wrong code with -O2 -fforce-addr ebotcazou at gcc dot gnu dot org
2007-10-11  5:48 ` ubizjak at gmail dot com
2007-10-12 15:28 ` manfred99 at gmx dot ch

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).