From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Georg-Johann Lay <avr@gjlay.de>
Cc: gcc-patches@gcc.gnu.org, Denis Chertykov <chertykov@gmail.com>
Subject: Re: [patch,avr,applied] PR target/112952 Fix attribute "io" et al. handling.
Date: Fri, 12 Jan 2024 04:37:02 +0100 [thread overview]
Message-ID: <20240112033702.GD2971@lug-owl.de> (raw)
In-Reply-To: <83b90302-bd7b-4064-8c8e-7495ebd3931e@gjlay.de>
[-- Attachment #1: Type: text/plain, Size: 2782 bytes --]
On Thu, 2024-01-04 17:28:02 +0100, Georg-Johann Lay <avr@gjlay.de> wrote:
> This fixes the avr-specific attributes io, io_low and address,
> that are all basically the same except that io and io_low imply
> assertions on allowed addressing modes.
> --- a/gcc/config/avr/avr.cc
> +++ b/gcc/config/avr/avr.cc
[...]
> @@ -10385,12 +10389,10 @@ avr_handle_addr_attribute (tree *node, tree name, tree args,
> }
> else if (io_p
> && (!tree_fits_shwi_p (arg)
> - || !(strcmp (IDENTIFIER_POINTER (name), "io_low") == 0
> - ? low_io_address_operand : io_address_operand)
> - (GEN_INT (TREE_INT_CST_LOW (arg)), QImode)))
> + || ! IN_RANGE (TREE_INT_CST_LOW (arg), io_start, io_end)))
> {
> - warning_at (loc, OPT_Wattributes, "%qE attribute address "
> - "out of range", name);
> + warning_at (loc, OPT_Wattributes, "%qE attribute address out of "
> + "range 0x%x...0x%x", name, (int) io_start, (int) io_end);
> *no_add = true;
> }
> else
Building with a recent GCC, this results in a new warning (here forced
to an error with --enable-werror-alway--enable-werror-always):
/var/lib/laminar/run/gcc-avr-elf/64/local-toolchain-install/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o avr.o -MT avr.o -MMD -MP -MF ./.deps/avr.TPo ../../gcc/gcc/config/avr/avr.cc
../../gcc/gcc/config/avr/avr.cc: In function 'tree_node* avr_handle_addr_attribute(tree_node**, tree, tree, int, bool*)':
../../gcc/gcc/config/avr/avr.cc:10391:45: error: unquoted sequence of 3 consecutive punctuation characters '...' in format [-Werror=format-diag]
10391 | warning_at (loc, OPT_Wattributes, "%qE attribute address out of "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10392 | "range 0x%x...0x%x", name, (int) io_start, (int) io_end);
| ~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2554: avr.o] Error 1
make[1]: Leaving directory '/var/lib/laminar/run/gcc-avr-elf/64/toolchain-build/gcc'
make: *** [Makefile:4676: all-gcc] Error 2
I think this should be "%<...%>".
MfG, JBG
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2024-01-12 3:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 16:28 Georg-Johann Lay
2024-01-12 3:37 ` Jan-Benedict Glaw [this message]
2024-01-12 12:32 ` Georg-Johann Lay
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=20240112033702.GD2971@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=avr@gjlay.de \
--cc=chertykov@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).