public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Ada broken with ICE in tree-ssa-structalias...
@ 2005-07-06  7:49 Andreas Jaeger
  2005-07-06  9:43 ` Laurent GUERBY
  2005-07-06 10:17 ` Andreas Schwab
  0 siblings, 2 replies; 8+ messages in thread
From: Andreas Jaeger @ 2005-07-06  7:49 UTC (permalink / raw)
  To: gcc; +Cc: Daniel Berlin

[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]


Building ada with the patch for flag_wrapv fails now with a new error:

+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050706 (experimental) (x86_64-suse-linux-gnu) GCC error:         |
| tree check: expected integer_cst, have cond_expr in                      |
|    do_structure_copy, at tree-ssa-structalias.c:2410                     |
| Error detected at g-socket.adb:2246:1                                    |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: Ada broken with ICE in tree-ssa-structalias...
  2005-07-06  7:49 Ada broken with ICE in tree-ssa-structalias Andreas Jaeger
@ 2005-07-06  9:43 ` Laurent GUERBY
  2005-07-06 10:17 ` Andreas Schwab
  1 sibling, 0 replies; 8+ messages in thread
From: Laurent GUERBY @ 2005-07-06  9:43 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: gcc, Daniel Berlin

Yes I see this new form of failure on x86_64-linux too as of
LAST_UPDATED Tue Jul  5 21:38:08 UTC 2005

I don't use the wrapv patch, just the following patch on gnattools:

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gnattools/Makefile.in,v
retrieving revision 1.4
diff -u -r1.4 Makefile.in
--- Makefile.in 30 Mar 2005 08:56:55 -0000      1.4
+++ Makefile.in 6 Jul 2005 09:41:45 -0000
@@ -83,7 +83,7 @@
        "CC=../../xgcc -B../../" \
        "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
        "LDFLAGS=$(LDFLAGS)" \
-       "ADAFLAGS=$(ADAFLAGS)" \
+       "ADAFLAGS=$(ADAFLAGS) -O0" \
        "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
        "ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
        "exeext=$(exeext)" \
@@ -112,7 +112,7 @@
 TOOLS_FLAGS_TO_PASS_NATIVE= \
        "CC=../../xgcc -B../../" \
        "CFLAGS=$(CFLAGS)" \
-       "ADAFLAGS=$(ADAFLAGS)" \
+       "ADAFLAGS=$(ADAFLAGS) -O0" \
        "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
        "ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)" \
        "exeext=$(exeext)" \

Laurent

On Wed, 2005-07-06 at 09:49 +0200, Andreas Jaeger wrote:
> Building ada with the patch for flag_wrapv fails now with a new error:
> 
> +===========================GNAT BUG DETECTED==============================+
> | 4.1.0 20050706 (experimental) (x86_64-suse-linux-gnu) GCC error:         |
> | tree check: expected integer_cst, have cond_expr in                      |
> |    do_structure_copy, at tree-ssa-structalias.c:2410                     |
> | Error detected at g-socket.adb:2246:1                                    |
> | Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
> | Use a subject line meaningful to you and us to track the bug.            |
> | Include the entire contents of this bug box in the report.               |
> | Include the exact gcc or gnatmake command that you entered.              |
> | Also include sources listed below in gnatchop format                     |
> | (concatenated together with no headers between files).                   |
> +==========================================================================+
> 
> Andreas

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

* Re: Ada broken with ICE in tree-ssa-structalias...
  2005-07-06  7:49 Ada broken with ICE in tree-ssa-structalias Andreas Jaeger
  2005-07-06  9:43 ` Laurent GUERBY
@ 2005-07-06 10:17 ` Andreas Schwab
  2005-07-06 10:54   ` [PR22319] " Geert Bosch
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2005-07-06 10:17 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: gcc, Daniel Berlin

Andreas Jaeger <aj@suse.de> writes:

> Building ada with the patch for flag_wrapv fails now with a new error:
>
> +===========================GNAT BUG DETECTED==============================+
> | 4.1.0 20050706 (experimental) (x86_64-suse-linux-gnu) GCC error:         |
> | tree check: expected integer_cst, have cond_expr in                      |
> |    do_structure_copy, at tree-ssa-structalias.c:2410                     |

Also on ia64 (without -fwrapv).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PR22319] Ada broken with ICE in tree-ssa-structalias...
  2005-07-06 10:17 ` Andreas Schwab
@ 2005-07-06 10:54   ` Geert Bosch
  2005-07-06 12:41     ` Daniel Berlin
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Bosch @ 2005-07-06 10:54 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Andreas Jaeger, gcc, Daniel Berlin

This is http://gcc.gnu.org/PR22319.

On Jul 6, 2005, at 06:17, Andreas Schwab wrote:
> Andreas Jaeger <aj@suse.de> writes:
>
>
>> Building ada with the patch for flag_wrapv fails now with a new  
>> error:
>>
>> +===========================GNAT BUG  
>> DETECTED==============================+
>> | 4.1.0 20050706 (experimental) (x86_64-suse-linux-gnu) GCC  
>> error:         |
>> | tree check: expected integer_cst, have cond_expr  
>> in                      |
>> |    do_structure_copy, at tree-ssa-structalias.c: 
>> 2410                     |
>>
>
> Also on ia64 (without -fwrapv).
>
> Andreas.
>
> -- 
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>

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

* Re: [PR22319] Ada broken with ICE in tree-ssa-structalias...
  2005-07-06 10:54   ` [PR22319] " Geert Bosch
@ 2005-07-06 12:41     ` Daniel Berlin
  2005-07-06 13:04       ` Andrew Pinski
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Berlin @ 2005-07-06 12:41 UTC (permalink / raw)
  To: Geert Bosch; +Cc: Andreas Schwab, Andreas Jaeger, gcc

[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]

Try the attached patch.

On Wed, 2005-07-06 at 06:54 -0400, Geert Bosch wrote:
> This is http://gcc.gnu.org/PR22319.
> 
> On Jul 6, 2005, at 06:17, Andreas Schwab wrote:
> > Andreas Jaeger <aj@suse.de> writes:
> >
> >
> >> Building ada with the patch for flag_wrapv fails now with a new  
> >> error:
> >>
> >> +===========================GNAT BUG  
> >> DETECTED==============================+
> >> | 4.1.0 20050706 (experimental) (x86_64-suse-linux-gnu) GCC  
> >> error:         |
> >> | tree check: expected integer_cst, have cond_expr  
> >> in                      |
> >> |    do_structure_copy, at tree-ssa-structalias.c: 
> >> 2410                     |
> >>
> >
> > Also on ia64 (without -fwrapv).
> >
> > Andreas.
> >
> > -- 
> > Andreas Schwab, SuSE Labs, schwab@suse.de
> > SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> > Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> > "And now for something completely different."
> >
> 


[-- Attachment #2: 22140.diff --]
[-- Type: text/x-patch, Size: 2306 bytes --]

Index: tree-ssa-structalias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-structalias.c,v
retrieving revision 2.12
diff -u -p -r2.12 tree-ssa-structalias.c
--- tree-ssa-structalias.c	5 Jul 2005 15:31:16 -0000	2.12
+++ tree-ssa-structalias.c	6 Jul 2005 03:21:38 -0000
@@ -2396,18 +2396,39 @@ do_structure_copy (tree lhsop, tree rhso
     }
   else
     {
+      tree rhstype = TREE_TYPE (rhsop);
+      tree lhstype = TREE_TYPE (lhsop);
+      tree rhstypesize = TYPE_SIZE (rhstype);
+      tree lhstypesize = TYPE_SIZE (lhstype);
+
+      /* If we have a variably sized types on the rhs or lhs, and a deref
+	 constraint, add the constraint, lhsconstraint = &ANYTHING.
+	 This is conservatively correct because either the lhs is an unknown
+	 sized var (if the constraint is SCALAR), or the lhs is a DEREF
+	 constraint, and every variable it can point to must be unknown sized
+	 anyway, so we don't need to worry about fields at all.  */
+      if ((rhs.type == DEREF && TREE_CODE (rhstypesize) != INTEGER_CST)
+	  || (lhs.type == DEREF && TREE_CODE (lhstypesize) != INTEGER_CST))
+	{
+	  rhs.var = anything_id;
+	  rhs.type = ADDRESSOF;
+	  rhs.offset = 0;
+	  process_constraint (new_constraint (lhs, rhs));
+	  return;
+	}
+
       /* The size only really matters insofar as we don't set more or less of
 	 the variable.  If we hit an unknown size var, the size should be the
 	 whole darn thing.  */
       if (get_varinfo (rhs.var)->is_unknown_size_var)
 	rhssize = ~0;
       else
-	rhssize = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (rhsop)));
+	rhssize = TREE_INT_CST_LOW (rhstypesize);
 
       if (get_varinfo (lhs.var)->is_unknown_size_var)
 	lhssize = ~0;
       else
-	lhssize = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (lhsop)));
+	lhssize = TREE_INT_CST_LOW (lhstypesize);
 
   
       if (rhs.type == SCALAR && lhs.type == SCALAR)  
@@ -2418,9 +2439,7 @@ do_structure_copy (tree lhsop, tree rhso
 	do_lhs_deref_structure_copy (lhs, rhs, MIN (lhssize, rhssize));
       else
 	{
-	  tree rhsdecl = get_varinfo (rhs.var)->decl;
-	  tree pointertype = TREE_TYPE (rhsdecl);
-	  tree pointedtotype = TREE_TYPE (pointertype);
+	  tree pointedtotype = lhstype;
 	  tree tmpvar;  
 
 	  gcc_assert (rhs.type == DEREF && lhs.type == DEREF);

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

* Re: [PR22319] Ada broken with ICE in tree-ssa-structalias...
  2005-07-06 12:41     ` Daniel Berlin
@ 2005-07-06 13:04       ` Andrew Pinski
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Pinski @ 2005-07-06 13:04 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Andreas Jaeger, gcc, Andreas Schwab, Geert Bosch


On Jul 6, 2005, at 8:40 AM, Daniel Berlin wrote:

> Try the attached patch.

This fixed it for me.

-- Pinski

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

* Re: [PR22319] Ada broken with ICE in tree-ssa-structalias...
  2005-07-06 14:33 Richard Kenner
@ 2005-07-06 14:58 ` Daniel Berlin
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Berlin @ 2005-07-06 14:58 UTC (permalink / raw)
  To: Richard Kenner; +Cc: gcc

On Wed, 2005-07-06 at 10:35 -0400, Richard Kenner wrote:
>     Try the attached patch.
> 
> In the case where I saw this ICE, the tree generated by Ada was not valid
> (had a type mismatch on a MODIFY_EXPR).  So the patch you sent may not
> necessarily be needed.

Well, it's actually still needed in other cases, so ...


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

* Re: [PR22319] Ada broken with ICE in tree-ssa-structalias...
@ 2005-07-06 14:33 Richard Kenner
  2005-07-06 14:58 ` Daniel Berlin
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Kenner @ 2005-07-06 14:33 UTC (permalink / raw)
  To: dberlin; +Cc: gcc

    Try the attached patch.

In the case where I saw this ICE, the tree generated by Ada was not valid
(had a type mismatch on a MODIFY_EXPR).  So the patch you sent may not
necessarily be needed.

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

end of thread, other threads:[~2005-07-06 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-06  7:49 Ada broken with ICE in tree-ssa-structalias Andreas Jaeger
2005-07-06  9:43 ` Laurent GUERBY
2005-07-06 10:17 ` Andreas Schwab
2005-07-06 10:54   ` [PR22319] " Geert Bosch
2005-07-06 12:41     ` Daniel Berlin
2005-07-06 13:04       ` Andrew Pinski
2005-07-06 14:33 Richard Kenner
2005-07-06 14:58 ` Daniel Berlin

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).