public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
@ 2012-10-21  5:25 zsojka at seznam dot cz
  2012-10-21 12:15 ` [Bug tree-optimization/55005] " zsojka at seznam dot cz
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2012-10-21  5:25 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55005
           Summary: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs
                    with -fPIC
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


Created attachment 28498
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28498
reduced testcase

There are various compiler flags that cause the FAIL.

Output:
$ gcc -O3 -fPIC testcase.c && ./a.out 
Aborted
$ gcc -O2 -funroll-loops -fPIC testcase.c && ./a.out 
Aborted
$ gcc -O2 -fpeel-loops -fPIC testcase.c && ./a.out 
Aborted
$ gcc -O2 -flto -fPIC testcase.c && ./a.out 
Aborted

Tested revisions:
r192641 - fail
r191586 - OK
4.7 r191640 - OK


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
@ 2012-10-21 12:15 ` zsojka at seznam dot cz
  2012-10-21 16:10 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2012-10-21 12:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2012-10-21 12:14:59 UTC ---
This isn't the only testcase that started failing recently.

One interesting flag combination:
$ gcc -O2 -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce testcase.c && ./a.out
Segmentation fault

In this case, the body of main() isn't generated at all, so the code runs away
immediatelly after jumping to main().

main:
.LFB2:
    .cfi_startproc
    .cfi_endproc
.LFE2:
    .size    main, .-main


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
  2012-10-21 12:15 ` [Bug tree-optimization/55005] " zsojka at seznam dot cz
@ 2012-10-21 16:10 ` mpolacek at gcc dot gnu.org
  2012-10-21 16:15 ` zsojka at seznam dot cz
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2012-10-21 16:10 UTC (permalink / raw)
  To: gcc-bugs


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-21
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> 2012-10-21 16:10:30 UTC ---
Started with http://gcc.gnu.org/viewcvs?view=revision&revision=192538


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
  2012-10-21 12:15 ` [Bug tree-optimization/55005] " zsojka at seznam dot cz
  2012-10-21 16:10 ` mpolacek at gcc dot gnu.org
@ 2012-10-21 16:15 ` zsojka at seznam dot cz
  2012-10-22  9:05 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2012-10-21 16:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Zdenek Sojka <zsojka at seznam dot cz> 2012-10-21 16:14:53 UTC ---
(In reply to comment #2)
> Started with http://gcc.gnu.org/viewcvs?view=revision&revision=192538

Thanks for bisecting. The testcase from comment #1 was failing even before that
(though instead of segfaulting, the code ended in an endless loop), so it might
be a bit different problem.


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2012-10-21 16:15 ` zsojka at seznam dot cz
@ 2012-10-22  9:05 ` rguenth at gcc dot gnu.org
  2012-10-22 12:54 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22  9:05 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2012-10-22  9:05 ` rguenth at gcc dot gnu.org
@ 2012-10-22 12:54 ` mpolacek at gcc dot gnu.org
  2012-10-22 13:09 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2012-10-22 12:54 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> 2012-10-22 12:53:47 UTC ---
$ gcc -O2 -funroll-loops -fPIC testcase.c && ./a.out
$ gcc -O2 -fpeel-loops -fPIC testcase.c && ./a.out 

seem to be fine with current trunk.  The others are failing though.


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2012-10-22 12:54 ` mpolacek at gcc dot gnu.org
@ 2012-10-22 13:09 ` mpolacek at gcc dot gnu.org
  2012-10-23 14:32 ` hubicka at gcc dot gnu.org
  2012-10-23 15:06 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2012-10-22 13:09 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> 2012-10-22 13:08:40 UTC ---
In .jump there's
;; Function main (main, funcdef_no=2, decl_uid=1727, cgraph_uid=2) (executed
once)

Deleted 22 trivially dead insns

3 basic blocks, 1 edges.

(note 5 0 4 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(note 4 5 0 2 NOTE_INSN_FUNCTION_BEG)

Doesn't look right.


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2012-10-22 13:09 ` mpolacek at gcc dot gnu.org
@ 2012-10-23 14:32 ` hubicka at gcc dot gnu.org
  2012-10-23 15:06 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-10-23 14:32 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-10-23 14:32:02 UTC ---
This is similar case as do-1.f90.  We have:

Statement _6 = m_5 * 2147483647;
 is executed at most 2 (bounded by 2) + 1 times in loop 1.

coming from:
  while (i--)
    {
      g (i * 2147483647);
    }
This overflows for i==4 and leads to undefined effect.
So I think the testcase is invalid. 

Honza


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

* [Bug tree-optimization/55005] [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC
  2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2012-10-23 14:32 ` hubicka at gcc dot gnu.org
@ 2012-10-23 15:06 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-23 15:06 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-23 15:05:46 UTC ---
Yeah, the undefined behavior is reached on the testcase unconditionally, so it
is definitely invalid.


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

end of thread, other threads:[~2012-10-23 15:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-21  5:25 [Bug tree-optimization/55005] New: [4.8 Regression] gcc.c-torture/execute/loop-3.c FAILs with -fPIC zsojka at seznam dot cz
2012-10-21 12:15 ` [Bug tree-optimization/55005] " zsojka at seznam dot cz
2012-10-21 16:10 ` mpolacek at gcc dot gnu.org
2012-10-21 16:15 ` zsojka at seznam dot cz
2012-10-22  9:05 ` rguenth at gcc dot gnu.org
2012-10-22 12:54 ` mpolacek at gcc dot gnu.org
2012-10-22 13:09 ` mpolacek at gcc dot gnu.org
2012-10-23 14:32 ` hubicka at gcc dot gnu.org
2012-10-23 15:06 ` jakub 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).