public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56837] New: -ftree-loop-distribute-patterns generates incorrect code
@ 2013-04-04  7:39 pmblakely at googlemail dot com
  2013-04-04  7:40 ` [Bug tree-optimization/56837] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pmblakely at googlemail dot com @ 2013-04-04  7:39 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56837
           Summary: -ftree-loop-distribute-patterns generates incorrect
                    code
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pmblakely@googlemail.com


Created attachment 29801
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29801
Compilation output from adding -v -save-temps

With gcc-4.8.0 release, and up to and including gcc-4.8-20130328,
-ftree-loop-distribute-patterns can give incorrect results:

Minimal test-case (named OptBug-4.8.C):

extern int __builtin_printf (__const char *__restrict __format, ...);

int main(void)
{
  bool* b = new bool[5];
  for(unsigned int i=0 ; i < 5 ; i++)
  {
    b[i] = true;
  }

  for(unsigned int i=0 ; i < 5 ; i++)
  {
    __builtin_printf("%d\n", b[i]);
  }

  return 0;
}

Compilation command: g++-4.8-20130328 OptBug-4.8.C -o OptBug-4.8 -O1
-ftree-loop-distribute-patterns

Expected output:
1
1
1
1
1

Actual output:
255
255
255
255
255

The expected output is produced if the -ftree-loop-distribute-patterns flag is
removed.
The incorrect behaviour is not exhibited by gcc-4.7.2.


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

end of thread, other threads:[~2013-04-04 11:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-04  7:39 [Bug tree-optimization/56837] New: -ftree-loop-distribute-patterns generates incorrect code pmblakely at googlemail dot com
2013-04-04  7:40 ` [Bug tree-optimization/56837] " pinskia at gcc dot gnu.org
2013-04-04  7:57 ` mpolacek at gcc dot gnu.org
2013-04-04  7:58 ` rguenth at gcc dot gnu.org
2013-04-04  8:32 ` rguenth at gcc dot gnu.org
2013-04-04 11:01 ` 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).