This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Too restrictive sanity check
- To: gcc-patches at gcc dot gnu dot org
- Subject: Too restrictive sanity check
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 19 Apr 2000 00:03:15 -0300
- Cc: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Organization: Cygnus Solutions, a Red Hat Company
The testcase in the attached patch fails to compile unless I disable
some sanity checks added by Jan Hubicka. I've verified that the
generated code actually keeps the stack aligned, so I think the check
is too restrictive, or should be checking something else. In this
case, stack_pointer_delta is 12, when we get to that point while
processing the outer function call. Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* calls.c (expand_call, emit_library_call_value_1): Comment out
the sanity check added by Jan Hubicka on Apr 12.
Index: gcc/calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.121
diff -u -r1.121 calls.c
--- gcc/calls.c 2000/04/13 13:58:59 1.121
+++ gcc/calls.c 2000/04/19 02:25:13
@@ -2816,11 +2816,15 @@
/* All arguments and registers used for the call must be set up by
now! */
+#if 0
+ /* There's something wrong with this check. On IA32, it fails
+ for g++.oliva/stkalign.C. */
#ifdef PREFERRED_STACK_BOUNDARY
- /* Stack must to be properly aligned now. */
+ /* Stack must be properly aligned now. */
if (stack_pointer_delta & (preferred_stack_boundary / BITS_PER_UNIT - 1))
abort();
#endif
+#endif
/* Generate the actual call instruction. */
emit_call_1 (funexp, fndecl, funtype, unadjusted_args_size,
@@ -3721,10 +3725,14 @@
valreg = (mem_value == 0 && outmode != VOIDmode
? hard_libcall_value (outmode) : NULL_RTX);
+#if 0
+ /* There may be something wrong with this check. On IA32, a similar
+ test in expand_call fails for g++.oliva/stkalign.C. */
#ifdef PREFERRED_STACK_BOUNDARY
- /* Stack must to be properly aligned now. */
+ /* Stack must be properly aligned now. */
if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1))
abort();
+#endif
#endif
/* We pass the old value of inhibit_defer_pop + 1 to emit_call_1, which
Index: gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
2000-04-18 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* stkalign.C: New test.
Index: gcc/testsuite/g++.old-deja/g++.oliva/stkalign.C
===================================================================
RCS file: stkalign.C
diff -N stkalign.C
--- gcc/testsuite/g++.old-deja/g++.oliva/stkalign.C Tue May 5 13:32:27 1998
+++ gcc/testsuite/g++.old-deja/g++.oliva/stkalign.C Tue Apr 18 19:25:13 2000
@@ -0,0 +1,17 @@
+// Build don't link:
+
+// Copyright (C) 2000 Free Software Foundation
+
+// by Alexandre Oliva <aoliva@cygnus.com>
+// distilled from libg++'s Fix.cc
+
+struct Integer {
+ ~Integer () {}
+};
+
+void foo (const Integer& y);
+Integer bar (const Integer& x);
+
+void show (const Integer& x) {
+ foo (bar (x));
+}
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me