public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: YunQiang Su <syq@gcc.gnu.org>
Cc: gcc-patches@gcc.gnu.org, pinskia@gcc.gnu.org, i@maskray.me
Subject: Re: [PATCH] Predefine __STRICT_ALIGN__ if STRICT_ALIGNMENT
Date: Mon, 18 Mar 2024 08:32:34 +0100 (CET)	[thread overview]
Message-ID: <9sq13s1p-0r80-0354-71rs-4q3s1s050208@fhfr.qr> (raw)
In-Reply-To: <20240317054631.848645-1-syq@gcc.gnu.org>

On Sun, 17 Mar 2024, YunQiang Su wrote:

> Arm32 predefines __ARM_FEATURE_UNALIGNED if -mno-unaligned-access,
> and RISC-V predefines __riscv_misaligned_avoid, while other ports
> that support -mstrict-align/-mno-unaligned-access don't have such
> macro, and these backend macros are only avaiable for c-family.
> Note: Arm64 always predefine __ARM_FEATURE_UNALIGNED: See #111555.
> 
> Let's add a generic one.

STRICT_ALIGNMENT is supposed to be gone, it doesn't tell the full
truth so exposing it will cause more confusion only.  Nak.

Richard.

> __STRICT_ALIGN__ is used instead of __STRICT_ALIGNMENT__, due to that
> the later is used by some softwares, such as lzo2, syslinux etc.
> 
> gcc
> 	* cppbuiltin.cc: Predefine __STRICT_ALIGNMENT__ if
> 	STRICT_ALIGNMENT.
> ---
>  gcc/cppbuiltin.cc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gcc/cppbuiltin.cc b/gcc/cppbuiltin.cc
> index c4bfc2917dc..d32efdf9a07 100644
> --- a/gcc/cppbuiltin.cc
> +++ b/gcc/cppbuiltin.cc
> @@ -123,6 +123,9 @@ define_builtin_macros_for_compilation_flags (cpp_reader *pfile)
>  
>    cpp_define_formatted (pfile, "__FINITE_MATH_ONLY__=%d",
>  			flag_finite_math_only);
> +
> +  if (STRICT_ALIGNMENT)
> +    cpp_define (pfile, "__STRICT_ALIGNMENT__");
>  }
>  
>  
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

      parent reply	other threads:[~2024-03-18  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-17  5:46 YunQiang Su
2024-03-17  6:04 ` Sam James
2024-03-17  7:27   ` YunQiang Su
2024-03-18  7:32 ` Richard Biener [this message]

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=9sq13s1p-0r80-0354-71rs-4q3s1s050208@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@maskray.me \
    --cc=pinskia@gcc.gnu.org \
    --cc=syq@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).