public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51246] New: ICE in replace_ref_with, at tree-predcom.c:1309
@ 2011-11-20 22:26 regehr at cs dot utah.edu
  2011-11-23 17:56 ` [Bug tree-optimization/51246] [4.7 Regression] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: regehr at cs dot utah.edu @ 2011-11-20 22:26 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51246
           Summary: ICE in replace_ref_with, at tree-predcom.c:1309
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


[regehr@gamow tmp067]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r181530-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r181530-install
--program-prefix=r181530- --enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 20111120 (experimental) (GCC) 

[regehr@gamow tmp067]$ current-gcc -c -w -Ofast small.c

small.c: In function 'func_2':
small.c:16:1: internal compiler error: in replace_ref_with, at
tree-predcom.c:1309
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[regehr@gamow tmp067]$ cat small.c


int
func_42 (int si1, int si2)
{
  return si1;
}

int
func_11 (int ui1, int ui2)
{
  return ui1;
}

char g_50;
int *g_71;
int *
func_2 ()
{
  int **l_422 = &g_71;
  for (;;)
    {
      int l_427;
      char *l_450 = &g_50;
      *l_422 = (*l_450 = func_11 (func_42 (l_427, 0), 0), &l_427);
    }
}


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

* [Bug tree-optimization/51246] [4.7 Regression] ICE in replace_ref_with, at tree-predcom.c:1309
  2011-11-20 22:26 [Bug c/51246] New: ICE in replace_ref_with, at tree-predcom.c:1309 regehr at cs dot utah.edu
@ 2011-11-23 17:56 ` jakub at gcc dot gnu.org
  2011-11-24  9:23 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-11-23 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-23
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.7.0
            Summary|ICE in replace_ref_with, at |[4.7 Regression] ICE in
                   |tree-predcom.c:1309         |replace_ref_with, at
                   |                            |tree-predcom.c:1309
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-23 17:29:40 UTC ---
Shorter testcase for -O3 -w:

int a, *b;

void
test (void)
{
  while (1)
    {
      int c;
      a = c;
      b = &c;
    }
}

Broken by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181172


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

* [Bug tree-optimization/51246] [4.7 Regression] ICE in replace_ref_with, at tree-predcom.c:1309
  2011-11-20 22:26 [Bug c/51246] New: ICE in replace_ref_with, at tree-predcom.c:1309 regehr at cs dot utah.edu
  2011-11-23 17:56 ` [Bug tree-optimization/51246] [4.7 Regression] " jakub at gcc dot gnu.org
@ 2011-11-24  9:23 ` jakub at gcc dot gnu.org
  2011-12-01 17:06 ` jakub at gcc dot gnu.org
  2011-12-01 17:08 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-11-24  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-24 08:25:40 UTC ---
Created attachment 25907
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25907
gcc47-pr51246.patch

I wonder whether we can't just adjust the assert here to also allow clobber on
the rhs.
Then
<bb 2>:

<bb 3>:
  c.0_1 = c;
  a = c.0_1;
  b = &c;
  c ={v} {CLOBBER};

<bb 4>:
  goto <bb 3>;
is transformed into:
<bb 2>:
  c.5_10 = c;

<bb 3>:
  # c_lsm0.4_8 = PHI <c.5_10(2), c_lsm0.4_9(4)>
  c.0_1 = c_lsm0.4_8;
  a = c.0_1;
  b = &c;
  c ={v} {CLOBBER};
  c_lsm0.4_9 ={v} {CLOBBER};

<bb 4>:
  goto <bb 3>;
That makes it clear that we use uninitialized variable in the next iteration
too.


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

* [Bug tree-optimization/51246] [4.7 Regression] ICE in replace_ref_with, at tree-predcom.c:1309
  2011-11-20 22:26 [Bug c/51246] New: ICE in replace_ref_with, at tree-predcom.c:1309 regehr at cs dot utah.edu
  2011-11-23 17:56 ` [Bug tree-optimization/51246] [4.7 Regression] " jakub at gcc dot gnu.org
  2011-11-24  9:23 ` jakub at gcc dot gnu.org
@ 2011-12-01 17:06 ` jakub at gcc dot gnu.org
  2011-12-01 17:08 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-12-01 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-01 17:03:40 UTC ---
Author: jakub
Date: Thu Dec  1 17:03:33 2011
New Revision: 181884

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181884
Log:
    PR tree-optimization/51246
    * tree-predcom.c (replace_ref_with): Handle also clobber on the
    rhs.

    * gcc.c-torture/compile/pr51246.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr51246.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-predcom.c


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

* [Bug tree-optimization/51246] [4.7 Regression] ICE in replace_ref_with, at tree-predcom.c:1309
  2011-11-20 22:26 [Bug c/51246] New: ICE in replace_ref_with, at tree-predcom.c:1309 regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2011-12-01 17:06 ` jakub at gcc dot gnu.org
@ 2011-12-01 17:08 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-12-01 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-01 17:07:25 UTC ---
Fixed.


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

end of thread, other threads:[~2011-12-01 17:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-20 22:26 [Bug c/51246] New: ICE in replace_ref_with, at tree-predcom.c:1309 regehr at cs dot utah.edu
2011-11-23 17:56 ` [Bug tree-optimization/51246] [4.7 Regression] " jakub at gcc dot gnu.org
2011-11-24  9:23 ` jakub at gcc dot gnu.org
2011-12-01 17:06 ` jakub at gcc dot gnu.org
2011-12-01 17:08 ` 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).