public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [rs6000] Fix compare debug failure on AIX
@ 2015-04-29 10:31 Eric Botcazou
  2015-04-29 10:37 ` pinskia
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Botcazou @ 2015-04-29 10:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Edelsohn

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

You can easily get -fcompare-debug failures on AIX with small functions, in 
fact you get the failure for the empty function:

void foo (void) {}

eric@polaris:~/build/gcc/powerpc-ibm-aix7.1> gcc/xgcc -Bgcc -S t.c -O -
fcompare-debug
xgcc: error: t.c: -fcompare-debug failure (length)

Fixed thusly, tested on powerpc-ibm-aix7.1, OK for the mainline?


2015-04-29  Eric Botcazou  <ebotcazou@adacore.com>

	* config/rs6000/rs6000.c (rs6000_stack_info): For XCOFF, replace test
	on debug info with test on optimization to decide stack pushing.


2015-04-29  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/empty3.c: New test.


-- 
Eric Botcazou

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

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 222439)
+++ config/rs6000/rs6000.c	(working copy)
@@ -21932,8 +21932,8 @@ rs6000_stack_info (void)
   /* Determine if we need to allocate any stack frame:
 
      For AIX we need to push the stack if a frame pointer is needed
-     (because the stack might be dynamically adjusted), if we are
-     debugging, if we make calls, or if the sum of fp_save, gp_save,
+     (because the stack might be dynamically adjusted), if we are not
+     optimizing, if we make calls, or if the sum of fp_save, gp_save,
      and local variables are more than the space needed to save all
      non-volatile registers: 32-bit: 18*8 + 19*4 = 220 or 64-bit: 18*8
      + 18*8 = 288 (GPR13 reserved).
@@ -21950,7 +21950,7 @@ rs6000_stack_info (void)
   else if (frame_pointer_needed)
     info_ptr->push_p = 1;
 
-  else if (TARGET_XCOFF && write_symbols != NO_DEBUG)
+  else if (TARGET_XCOFF && !optimize)
     info_ptr->push_p = 1;
 
   else

[-- Attachment #3: empty3.c --]
[-- Type: text/x-csrc, Size: 61 bytes --]

/* { dg-options "-O -fcompare-debug" } */

void foo (void) {}

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

end of thread, other threads:[~2015-05-11  8:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29 10:31 [rs6000] Fix compare debug failure on AIX Eric Botcazou
2015-04-29 10:37 ` pinskia
2015-04-30 11:35   ` Eric Botcazou
2015-05-01 13:48     ` David Edelsohn
2015-05-02  4:24       ` Alan Modra
2015-05-02 10:05       ` Eric Botcazou
2015-05-04  0:32         ` David Edelsohn
2015-05-04  8:33           ` Richard Biener
2015-05-04 13:26           ` Tristan Gingold
2015-05-11  8:25           ` Eric Botcazou

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