* [PATCH] Fix x86-64 ICE with offsetted LABEL_REF
@ 2002-10-23 1:23 Jakub Jelinek
2002-10-23 10:08 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2002-10-23 1:23 UTC (permalink / raw)
To: rth, jh; +Cc: gcc-patches
Hi!
The following testcase ICEd because of my x86-64 TLS patch, since although
almost all places started accepting LABEL_REF + small_int as valid
sign extended displacement in CM_SMALL_PIC, local_symbolic_operand
considered only LABEL_REF without any offset.
Ok to commit?
2002-10-23 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (local_symbolic_operand): Move LABEL_REF test
after CONST test.
* gcc.dg/20021023-1.c: New test.
--- gcc/config/i386/i386.c.jj 2002-10-22 23:51:41.000000000 +0200
+++ gcc/config/i386/i386.c 2002-10-23 00:40:10.000000000 +0200
@@ -3067,9 +3067,6 @@ local_symbolic_operand (op, mode)
rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
- if (GET_CODE (op) == LABEL_REF)
- return 1;
-
if (GET_CODE (op) == CONST
&& GET_CODE (XEXP (op, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
@@ -3078,6 +3075,9 @@ local_symbolic_operand (op, mode)
&& INTVAL (XEXP (XEXP (op, 0), 1)) < 16*1024*1024)))
op = XEXP (XEXP (op, 0), 0);
+ if (GET_CODE (op) == LABEL_REF)
+ return 1;
+
if (GET_CODE (op) != SYMBOL_REF)
return 0;
--- gcc/testsuite/gcc.dg/20021023-1.c.jj 2002-10-23 00:53:17.000000000 +0200
+++ gcc/testsuite/gcc.dg/20021023-1.c 2002-10-23 00:52:52.000000000 +0200
@@ -0,0 +1,24 @@
+/* This testcase ICEd on x86-64 because LABEL_REF + small const was not
+ considered as local_symbolic_operand. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic" } */
+
+typedef __builtin_va_list va_list;
+
+static unsigned int
+foo (void *a, float b, const char *c, va_list d, void *e)
+{
+ return -1;
+}
+
+unsigned int
+bar (void *a, float b, const char *c, ...)
+{
+ va_list args;
+ unsigned int d;
+
+ __builtin_stdarg_start (args, c);
+ d = foo (a, b, c, args, a);
+ __builtin_va_end (args);
+ return d;
+}
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix x86-64 ICE with offsetted LABEL_REF
2002-10-23 1:23 [PATCH] Fix x86-64 ICE with offsetted LABEL_REF Jakub Jelinek
@ 2002-10-23 10:08 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-10-23 10:08 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: jh, gcc-patches
On Wed, Oct 23, 2002 at 10:23:34AM +0200, Jakub Jelinek wrote:
> * config/i386/i386.c (local_symbolic_operand): Move LABEL_REF test
> after CONST test.
>
> * gcc.dg/20021023-1.c: New test.
Ok.
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-10-23 17:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-23 1:23 [PATCH] Fix x86-64 ICE with offsetted LABEL_REF Jakub Jelinek
2002-10-23 10:08 ` Richard Henderson
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).