public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Kazu Hirata <kazu@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, law@redhat.com, schwab@suse.de,
	     nathan@codesourcery.com
Subject: Re: [patch] m68k: Fix binary compatibility problem with -mno-strict-align.  (Take 2)
Date: Wed, 29 Aug 2007 14:57:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0708291622280.1820@scrub.home> (raw)
In-Reply-To: <200708251536.l7PFa18t031289@sparrowhawk.codesourcery.com>

Hi,

On Sat, 25 Aug 2007, Kazu Hirata wrote:

> Hi,
> 
> Attached is a revised patch to fix binary compatibility problem with
> -mno-strict-align on m68k-elf.
> 
> The previous iteration of this patch is at:
> 
>   http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01437.html
> 
> In this iteration, Nathan has made a change to effectively comment out
> TARGET_RETURN_IN_MEMORY and m68k_return_in_memory if
> M68K_HONOR_TARGET_STRICT_ALIGNMENT is defined.  This way, this patch
> has no effect on m68k-linux, preserving the ABI.

Looking at this a little closer, I'm not sure why this is related to 
alignment in first place. Whether a structure is returned in a register 
should be controlled by -fpcc-struct-return/-freg-struct-return and the 
DEFAULT_PCC_STRUCT_RETURN value in the config. In 
function.c:aggregate_value_p there is shortly after the return_in_memory 
hook the following test:

  if (flag_pcc_struct_return && AGGREGATE_TYPE_P (type))
    return 1;

IMO the alignment should have no influence here, so where is this coming 
from? 

Looking at the default value of DEFAULT_PCC_STRUCT_RETURN:

$ grep DEFAULT_PCC_STRUCT_RETURN gcc/*.c gcc/config/m68k/*.h
gcc/toplev.c:#ifndef DEFAULT_PCC_STRUCT_RETURN
gcc/toplev.c:#define DEFAULT_PCC_STRUCT_RETURN 1
gcc/toplev.c:int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
gcc/config/m68k/linux.h:#define DEFAULT_PCC_STRUCT_RETURN 0
gcc/config/m68k/m68kemb.h:#define DEFAULT_PCC_STRUCT_RETURN 0
gcc/config/m68k/netbsd-elf.h:#undef DEFAULT_PCC_STRUCT_RETURN
gcc/config/m68k/netbsd-elf.h:#define DEFAULT_PCC_STRUCT_RETURN 1
gcc/config/m68k/openbsd.h:#define DEFAULT_PCC_STRUCT_RETURN 0

m68k-elf includes m68kemb.h, which sets this to 0, so why isn't this 
honored?

bye, Roman

  parent reply	other threads:[~2007-08-29 14:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25 15:59 Kazu Hirata
2007-08-28 13:32 ` Andreas Schwab
2007-08-29 14:57 ` Roman Zippel [this message]
2007-08-29 15:26   ` Kazu Hirata
2007-08-29 16:11     ` Roman Zippel
2007-08-29 17:14       ` Nathan Sidwell
2007-08-29 18:19         ` Roman Zippel
2007-08-29 18:28           ` Nathan Sidwell
2007-08-29 16:53   ` Nathan Sidwell

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=Pine.LNX.4.64.0708291622280.1820@scrub.home \
    --to=zippel@linux-m68k.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kazu@codesourcery.com \
    --cc=law@redhat.com \
    --cc=nathan@codesourcery.com \
    --cc=schwab@suse.de \
    /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).