public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42662] New: invalid rtl sharing found in the insn
@ 2010-01-08 18:09 dcb314 at hotmail dot com
2010-01-08 18:10 ` [Bug c/42662] " dcb314 at hotmail dot com
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2010-01-08 18:09 UTC (permalink / raw)
To: gcc-bugs
I just tried to compile the package cross-avr-gcc44 with the GNU
C compiler version 4.5 snapshot 20100107 and the compiler said
../../gcc/real.c:2486:1: error: invalid rtl sharing found in the insn
(debug_insn 287 285 289 22 ../../gcc/real.c:291 (var_location:QI D#65 (ltu:QI
(plus:DI (mult:DI (reg:DI 520 [ ai ])
(const_int 2 [0x2]))
(reg:DI 277 [ D.25377 ]))
(mult:DI (reg:DI 520 [ ai ])
(const_int 2 [0x2])))) -1 (nil))
../../gcc/real.c:2486:1: error: shared rtx
(mult:DI (reg:DI 520 [ ai ])
(const_int 2 [0x2]))
../../gcc/real.c:2486:1: internal compiler error: internal consistency failure
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Preprocessed source code attached. Flags -g -O3 required.
--
Summary: invalid rtl sharing found in the insn
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dcb314 at hotmail dot com
GCC host triplet: x86_64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/42662] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
@ 2010-01-08 18:10 ` dcb314 at hotmail dot com
2010-01-08 18:11 ` [Bug debug/42662] [4.5 Regression] " pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2010-01-08 18:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dcb314 at hotmail dot com 2010-01-08 18:10 -------
Created an attachment (id=19510)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19510&action=view)
C source code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
2010-01-08 18:10 ` [Bug c/42662] " dcb314 at hotmail dot com
@ 2010-01-08 18:11 ` pinskia at gcc dot gnu dot org
2010-01-09 17:25 ` jakub at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-01-08 18:11 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |debug
Keywords| |ice-on-valid-code
Summary|invalid rtl sharing found in|[4.5 Regression] invalid rtl
|the insn |sharing found in the insn
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
2010-01-08 18:10 ` [Bug c/42662] " dcb314 at hotmail dot com
2010-01-08 18:11 ` [Bug debug/42662] [4.5 Regression] " pinskia at gcc dot gnu dot org
@ 2010-01-09 17:25 ` jakub at gcc dot gnu dot org
2010-01-09 20:35 ` hjl dot tools at gmail dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-09 17:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jakub at gcc dot gnu dot org 2010-01-09 17:25 -------
Smaller testcase that ICEs at -g -O2:
struct S { unsigned long s[17]; };
static inline void
foo (struct S *r, struct S *a, unsigned n)
{
unsigned b = n / 8;
r->s[0] = (b >= 1 ? : a->s[1 - b]);
}
static inline void
bar (struct S *r, struct S *a)
{
r->s[0] = a->s[0] << 1;
}
static inline void
baz (struct S *r, struct S *a, struct S *b)
{
unsigned c = 0;
int i;
for (i = 0; i < 3; ++i)
{
unsigned long d = a->s[i];
long e = d + b->s[i];
if (c)
++e == 0;
c = e < d;
r->s[i] = e;
}
}
void
test (struct S *r, int s, int d)
{
struct S u;
if (s)
{
bar (&u, r);
foo (r, r, 3);
baz (r, r, &u);
}
u.s[0] = d;
baz (r, r, &u);
}
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-01-09 17:25:17
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (2 preceding siblings ...)
2010-01-09 17:25 ` jakub at gcc dot gnu dot org
@ 2010-01-09 20:35 ` hjl dot tools at gmail dot com
2010-01-11 9:25 ` jakub at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-01-09 20:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hjl dot tools at gmail dot com 2010-01-09 20:35 -------
It is caused by revision 153037:
http://gcc.gnu.org/ml/gcc-cvs/2009-10/msg00690.html
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rsandifo at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (3 preceding siblings ...)
2010-01-09 20:35 ` hjl dot tools at gmail dot com
@ 2010-01-11 9:25 ` jakub at gcc dot gnu dot org
2010-01-11 9:36 ` jzhang918 at gmail dot com
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-11 9:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2010-01-11 09:25 -------
Testing a patch.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2010-01-09 17:25:17 |2010-01-11 09:25:27
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (4 preceding siblings ...)
2010-01-11 9:25 ` jakub at gcc dot gnu dot org
@ 2010-01-11 9:36 ` jzhang918 at gmail dot com
2010-01-11 9:47 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jzhang918 at gmail dot com @ 2010-01-11 9:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jzhang918 at gmail dot com 2010-01-11 09:36 -------
I just submitted a patch several days ago:
http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00130.html
I think it might be able to fix this bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (5 preceding siblings ...)
2010-01-11 9:36 ` jzhang918 at gmail dot com
@ 2010-01-11 9:47 ` jakub at gcc dot gnu dot org
2010-01-11 10:11 ` jzhang918 at gmail dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-11 9:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2010-01-11 09:46 -------
Created an attachment (id=19537)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19537&action=view)
gcc45-pr42662.patch
Fix.
Regarding the above mentioned patch, it looks like a big hammer, which will
create a lot of garbage. Are you sure you have investigated where exactly the
sharing originates from? On the line this patch is fixing XEXP (op0, 0) is
used
twice, once inside the plus and once as the second comparison operand. So it
is clearly where the bug is introduced. Another place which also introduces
something similar (x*x scalar floating optimization) already uses properly
copy_rtx.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (6 preceding siblings ...)
2010-01-11 9:47 ` jakub at gcc dot gnu dot org
@ 2010-01-11 10:11 ` jzhang918 at gmail dot com
2010-01-12 9:46 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jzhang918 at gmail dot com @ 2010-01-11 10:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jzhang918 at gmail dot com 2010-01-11 10:11 -------
Sorry, I should have checked my patch with the test code you posted before I
added that comment. My patch does not fix this one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (7 preceding siblings ...)
2010-01-11 10:11 ` jzhang918 at gmail dot com
@ 2010-01-12 9:46 ` jakub at gcc dot gnu dot org
2010-01-12 9:47 ` jakub at gcc dot gnu dot org
2010-01-13 10:08 ` jakub at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-12 9:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jakub at gcc dot gnu dot org 2010-01-12 09:45 -------
Subject: Bug 42662
Author: jakub
Date: Tue Jan 12 09:45:19 2010
New Revision: 155831
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155831
Log:
PR debug/42662
* simplify-rtx.c (simplify_relational_operation_1): Avoid invalid rtx
sharing when canonicalizing ({lt,ge}u (plus a b) b).
* gcc.dg/pr42662.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr42662.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/simplify-rtx.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (8 preceding siblings ...)
2010-01-12 9:46 ` jakub at gcc dot gnu dot org
@ 2010-01-12 9:47 ` jakub at gcc dot gnu dot org
2010-01-13 10:08 ` jakub at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-12 9:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2010-01-12 09:47 -------
Subject: Bug 42662
Author: jakub
Date: Tue Jan 12 09:47:07 2010
New Revision: 155832
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155832
Log:
PR debug/42662
* simplify-rtx.c (simplify_relational_operation_1): Avoid invalid rtx
sharing when canonicalizing ({lt,ge}u (plus a b) b).
* gcc.dg/pr42662.c: New test.
Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42662.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/simplify-rtx.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug debug/42662] [4.5 Regression] invalid rtl sharing found in the insn
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
` (9 preceding siblings ...)
2010-01-12 9:47 ` jakub at gcc dot gnu dot org
@ 2010-01-13 10:08 ` jakub at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-13 10:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jakub at gcc dot gnu dot org 2010-01-13 10:07 -------
Fixed.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42662
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-01-13 10:08 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-08 18:09 [Bug c/42662] New: invalid rtl sharing found in the insn dcb314 at hotmail dot com
2010-01-08 18:10 ` [Bug c/42662] " dcb314 at hotmail dot com
2010-01-08 18:11 ` [Bug debug/42662] [4.5 Regression] " pinskia at gcc dot gnu dot org
2010-01-09 17:25 ` jakub at gcc dot gnu dot org
2010-01-09 20:35 ` hjl dot tools at gmail dot com
2010-01-11 9:25 ` jakub at gcc dot gnu dot org
2010-01-11 9:36 ` jzhang918 at gmail dot com
2010-01-11 9:47 ` jakub at gcc dot gnu dot org
2010-01-11 10:11 ` jzhang918 at gmail dot com
2010-01-12 9:46 ` jakub at gcc dot gnu dot org
2010-01-12 9:47 ` jakub at gcc dot gnu dot org
2010-01-13 10:08 ` jakub at gcc dot gnu dot 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).