public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63602] New: Wrong code w/ -O2 -ftree-loop-linear
@ 2014-10-20 11:30 asolokha at gmx dot com
  2014-10-21  4:58 ` [Bug tree-optimization/63602] " asolokha at gmx dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: asolokha at gmx dot com @ 2014-10-20 11:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63602

            Bug ID: 63602
           Summary: Wrong code w/ -O2 -ftree-loop-linear
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com

gcc produces wrong code w/ -ftree-loop-linear -O2 (and above) for the following
reduced case:

int sx;
int bn;
int vz = 1;
int *volatile n6 = &bn;

int
main(void)
{
  for (int i = 0; i < 3; ++i) {
    sx = vz;
    vz = bn;
  }
  return sx;
}

It struck me first w/ gcc-4.10.0-alpha20140810, but today I've reproduced it w/
4.8.3, 4.9.1 and 5-alpha20141019, so I'm not marking it as a regression.

Expected results:
% gcc-5.0_alpha20141019 -O2 -o good 963b8772.c
% ./good
% echo $?
0

Actual results:
% gcc-5.0_alpha20141019 -O2 -ftree-loop-linear -o bad 963b8772.c
% ./bad
% echo $?
1


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

end of thread, other threads:[~2015-10-16  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20 11:30 [Bug tree-optimization/63602] New: Wrong code w/ -O2 -ftree-loop-linear asolokha at gmx dot com
2014-10-21  4:58 ` [Bug tree-optimization/63602] " asolokha at gmx dot com
2015-05-13 10:54 ` [Bug tree-optimization/63602] [5/6 Regression] " asolokha at gmx dot com
2015-08-19 12:28 ` bernd.edlinger at hotmail dot de
2015-10-16  8:28 ` rguenth at gcc dot gnu.org

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