[Bug middle-end/112938] ice with -fstrub=internal

2024-04-18 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

Alexandre Oliva  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|REOPENED|RESOLVED

--- Comment #12 from Alexandre Oliva  ---
Fixed

[Bug middle-end/112938] ice with -fstrub=internal

2024-04-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

--- Comment #11 from GCC Commits  ---
The master branch has been updated by Alexandre Oliva :

https://gcc.gnu.org/g:c39dc5bb65c492fafc5a0fde83708b8d24e0338d

commit r14-9985-gc39dc5bb65c492fafc5a0fde83708b8d24e0338d
Author: Alexandre Oliva 
Date:   Tue Apr 16 01:24:59 2024 -0300

[strub] improve handling of indirected volatile parms [PR112938]

The earlier patch for PR112938 arranged for volatile parms to be made
indirect in internal strub wrapped bodies.

The first problem that remained, more evident, was that the indirected
parameter remained volatile, despite the indirection, but it wasn't
regimplified, so indirecting it was malformed gimple.

Regimplifying turned out not to be needed.  The best course of action
was to drop the volatility from the by-reference parm, that was being
unexpectedly inherited from the original volatile parm.

That exposed another problem: the dereferences would then lose their
volatile status, so we had to bring volatile back to them.


for  gcc/ChangeLog

PR middle-end/112938
* ipa-strub.cc (pass_ipa_strub::execute): Drop volatility from
indirected parm.
(maybe_make_indirect): Restore volatility in dereferences.

for  gcc/testsuite/ChangeLog

PR middle-end/112938
* g++.dg/strub-internal-pr112938.cc: New.

[Bug middle-end/112938] ice with -fstrub=internal

2024-03-08 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

--- Comment #10 from Alexandre Oliva  ---
Thanks, yeah, I can duplicate the problem using the original testcase.

[Bug middle-end/112938] ice with -fstrub=internal

2024-02-28 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

David Binderman  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #9 from David Binderman  ---
The reduced source code of comment 1 seems to compile ok, but the original 
attached source code doesn't.

[Bug middle-end/112938] ice with -fstrub=internal

2024-02-27 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

--- Comment #8 from David Binderman  ---
(In reply to Alexandre Oliva from comment #7)
> Fixed.

Seems to have reappeared:

$ ~/gcc/results/bin/gcc -c -fstrub=internal bug988.cc
bt2_locks.cpp: In function ‘void mcs_lock::spin_while_eq(const volatile
std::atomic_bool&, bool)’:
bt2_locks.cpp:36:1: error: invalid address operand in ‘mem_ref’
*expected;

# VUSE <.MEM_8>
expected.8_3 ={v} *expected;
during IPA pass: strub
bt2_locks.cpp:36:1: internal compiler error: verify_gimple failed
0x11f4a92 verify_gimple_in_cfg(function*, bool, bool)
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/tree-cfg.cc:5663
0x1065788 execute_function_todo(function*, void*)
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/passes.cc:2088

I would be grateful if someone could confirm what I am seeing here.

[Bug middle-end/112938] ice with -fstrub=internal

2023-12-19 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

Alexandre Oliva  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Alexandre Oliva  ---
Fixed.

[Bug middle-end/112938] ice with -fstrub=internal

2023-12-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

--- Comment #6 from GCC Commits  ---
The master branch has been updated by Alexandre Oliva :

https://gcc.gnu.org/g:e1e71b4e0681974b3db41afa7fc18720a30d6848

commit r14-6547-ge1e71b4e0681974b3db41afa7fc18720a30d6848
Author: Alexandre Oliva 
Date:   Thu Dec 14 10:41:19 2023 -0300

strub: indirect volatile parms in wrappers

Arrange for strub internal wrappers to pass volatile arguments by
reference to the wrapped bodies.


for  gcc/ChangeLog

PR middle-end/112938
* ipa-strub.cc (pass_ipa_strub::execute): Pass volatile args
by reference to internal strub wrapped bodies.

for  gcc/testsuite/ChangeLog

PR middle-end/112938
* gcc.dg/strub-internal-volatile.c: Check indirection of
volatile args.

[Bug middle-end/112938] ice with -fstrub=internal

2023-12-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Alexandre Oliva :

https://gcc.gnu.org/g:37afeec8a635153ccd4e91bd686c93217706894d

commit r14-6546-g37afeec8a635153ccd4e91bd686c93217706894d
Author: Alexandre Oliva 
Date:   Thu Dec 14 10:41:13 2023 -0300

strub: handle volatile promoted args in internal strub [PR112938]

When generating code for an internal strub wrapper, don't clear the
DECL_NOT_GIMPLE_REG_P flag of volatile args, and gimplify them both
before and after any conversion.

While at that, move variable TMP into narrower scopes so that it's
more trivial to track where ARG lives.


for  gcc/ChangeLog

PR middle-end/112938
* ipa-strub.cc (pass_ipa_strub::execute): Handle promoted
volatile args in internal strub.  Simplify.

for  gcc/testsuite/ChangeLog

PR middle-end/112938
* gcc.dg/strub-internal-volatile.c: New.

[Bug middle-end/112938] ice with -fstrub=internal

2023-12-11 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

--- Comment #4 from Alexandre Oliva  ---
Patch at https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640252.html

[Bug middle-end/112938] ice with -fstrub=internal

2023-12-11 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

Alexandre Oliva  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |aoliva at gcc dot 
gnu.org

--- Comment #3 from Alexandre Oliva  ---
Mine, thanks for the report, and for the reduced testcases!

[Bug middle-end/112938] ice with -fstrub=internal

2023-12-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112938

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=48274,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=112877
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2023-12-09
 Ever confirmed|0   |1
 Target||x86_64-linux-gnu

--- Comment #2 from Andrew Pinski  ---
Reduced C testcase:
```
void f(volatile short) {}
void g() { f(0); }
```

The problem happens on x86_64 and not aarch64 due to TARGET_PROMOTE_PROTOTYPES
macro.