public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: YunQiang Su <syq@gcc.gnu.org>
Cc: gcc-patches@gcc.gnu.org,  pinskia@gcc.gnu.org,  i@maskray.me,
	rguenther@suse.de
Subject: Re: [PATCH] Predefine __STRICT_ALIGN__ if STRICT_ALIGNMENT
Date: Sun, 17 Mar 2024 06:04:36 +0000	[thread overview]
Message-ID: <87v85lxukr.fsf@gentoo.org> (raw)
In-Reply-To: <20240317054631.848645-1-syq@gcc.gnu.org> (YunQiang Su's message of "Sun, 17 Mar 2024 13:46:31 +0800")

YunQiang Su <syq@gcc.gnu.org> writes:

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

I would say tag the bug even if you're not fixing it, as it was related
enough for you to cite it.

>
> Let's add a generic one.
>
> __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__");
>  }

  reply	other threads:[~2024-03-17  6:04 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 [this message]
2024-03-17  7:27   ` YunQiang Su
2024-03-18  7:32 ` Richard Biener

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=87v85lxukr.fsf@gentoo.org \
    --to=sam@gentoo.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@maskray.me \
    --cc=pinskia@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --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).