public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: David Edelsohn <dje.gcc@gmail.com>
Subject: [rs6000] Fix compare debug failure on AIX
Date: Wed, 29 Apr 2015 10:31:00 -0000	[thread overview]
Message-ID: <1633828.L6eKc0dpVU@polaris> (raw)

[-- 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) {}

             reply	other threads:[~2015-04-29 10:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 10:31 Eric Botcazou [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1633828.L6eKc0dpVU@polaris \
    --to=ebotcazou@adacore.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).