public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] sh: Fix up __attribute__((optimize ("Os"))) handling on SH [PR105069]
@ 2022-03-31  8:30 Jakub Jelinek
  2022-04-06 15:26 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2022-03-31  8:30 UTC (permalink / raw)
  To: Alexandre Oliva, Oleg Endo, Jeff Law; +Cc: gcc-patches, Martin Liška

Hi!

As mentioned in the PR, various tests on sh-elf ICE like:
make check-gcc RUNTESTFLAGS="compile.exp='pr104327.c pr58332.c pr81360.c pr84425.c'"
FAIL: gcc.c-torture/compile/pr104327.c   -O0  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr104327.c   -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/pr104327.c   -O1  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr104327.c   -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/pr104327.c   -O2  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr104327.c   -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr104327.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr104327.c   -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr104327.c   -Os  (test for excess errors)
FAIL: gcc.c-torture/compile/pr58332.c   -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/pr58332.c   -O1  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr58332.c   -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/pr58332.c   -O2  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr58332.c   -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr58332.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr58332.c   -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr58332.c   -Os  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr58332.c   -Os  (test for excess errors)
FAIL: gcc.c-torture/compile/pr81360.c   -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/pr81360.c   -O1  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr81360.c   -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/pr81360.c   -O2  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr81360.c   -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr81360.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr81360.c   -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr81360.c   -Os  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr81360.c   -Os  (test for excess errors)
FAIL: gcc.c-torture/compile/pr84425.c   -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/pr84425.c   -O1  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr84425.c   -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/pr84425.c   -O2  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr84425.c   -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr84425.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr84425.c   -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr84425.c   -Os  (internal compiler error: 'global_options' are modified in local context)
FAIL: gcc.c-torture/compile/pr84425.c   -Os  (test for excess errors)
With the following patch, none of those tests ICE anymore, though
pr104327.c still FAILs with:
Excess errors:
/usr/src/gcc/gcc/testsuite/gcc.c-torture/compile/pr104327.c:6:1: error: inlining failed in call to 'always_inline' 'bar': target specific option mismatch
I think that would be fixable by overriding TARGET_CAN_INLINE_P
hook and allowing at least for always_inline changes in sh_div_str.

Is the following patch ok for trunk as at least a small step forward?

2022-03-31  Jakub Jelinek  <jakub@redhat.com>

	PR target/105069
	* config/sh/sh.opt (mdiv=): Add Save.

--- gcc/config/sh/sh.opt.jj	2022-01-11 23:11:21.990295775 +0100
+++ gcc/config/sh/sh.opt	2022-03-31 09:43:45.916244944 +0200
@@ -207,7 +207,7 @@ Target RejectNegative Mask(ALIGN_DOUBLE)
 Align doubles at 64-bit boundaries.
 
 mdiv=
-Target RejectNegative Joined Var(sh_div_str) Init("")
+Target Save RejectNegative Joined Var(sh_div_str) Init("")
 Division strategy, one of: call-div1, call-fp, call-table.
 
 mdivsi3_libfunc=

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sh: Fix up __attribute__((optimize ("Os"))) handling on SH [PR105069]
  2022-03-31  8:30 [PATCH] sh: Fix up __attribute__((optimize ("Os"))) handling on SH [PR105069] Jakub Jelinek
@ 2022-04-06 15:26 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2022-04-06 15:26 UTC (permalink / raw)
  To: Jakub Jelinek, Alexandre Oliva, Oleg Endo; +Cc: gcc-patches, Martin Liška



On 3/31/2022 2:30 AM, Jakub Jelinek wrote:
> Hi!
>
> As mentioned in the PR, various tests on sh-elf ICE like:
> make check-gcc RUNTESTFLAGS="compile.exp='pr104327.c pr58332.c pr81360.c pr84425.c'"
> FAIL: gcc.c-torture/compile/pr104327.c   -O0  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr104327.c   -O0  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr104327.c   -O1  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr104327.c   -O1  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr104327.c   -O2  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr104327.c   -O2  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr104327.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr104327.c   -O3 -g  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr104327.c   -Os  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr58332.c   -O0  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr58332.c   -O1  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr58332.c   -O1  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr58332.c   -O2  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr58332.c   -O2  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr58332.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr58332.c   -O3 -g  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr58332.c   -Os  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr58332.c   -Os  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr81360.c   -O0  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr81360.c   -O1  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr81360.c   -O1  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr81360.c   -O2  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr81360.c   -O2  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr81360.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr81360.c   -O3 -g  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr81360.c   -Os  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr81360.c   -Os  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr84425.c   -O0  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr84425.c   -O1  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr84425.c   -O1  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr84425.c   -O2  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr84425.c   -O2  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr84425.c   -O3 -g  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr84425.c   -O3 -g  (test for excess errors)
> FAIL: gcc.c-torture/compile/pr84425.c   -Os  (internal compiler error: 'global_options' are modified in local context)
> FAIL: gcc.c-torture/compile/pr84425.c   -Os  (test for excess errors)
> With the following patch, none of those tests ICE anymore, though
> pr104327.c still FAILs with:
> Excess errors:
> /usr/src/gcc/gcc/testsuite/gcc.c-torture/compile/pr104327.c:6:1: error: inlining failed in call to 'always_inline' 'bar': target specific option mismatch
> I think that would be fixable by overriding TARGET_CAN_INLINE_P
> hook and allowing at least for always_inline changes in sh_div_str.
>
> Is the following patch ok for trunk as at least a small step forward?
>
> 2022-03-31  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR target/105069
> 	* config/sh/sh.opt (mdiv=): Add Save.
OK.   IIRC sh isn't the only target that's broken for this stuff.

Jeff


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-06 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  8:30 [PATCH] sh: Fix up __attribute__((optimize ("Os"))) handling on SH [PR105069] Jakub Jelinek
2022-04-06 15:26 ` Jeff Law

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