[Bug tree-optimization/114799] [14 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -O2 -fno-vect-cost-model

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114799

Andrew Pinski  changed:

   What|Removed |Added

Summary|[14 Regression] ICE: tree   |[14 Regression] ICE: tree
   |check: expected class   |check: expected class
   |'type', have 'exceptional'  |'type', have 'exceptional'
   |(error_mark) in |(error_mark) in
   |useless_type_conversion_p,  |useless_type_conversion_p,
   |at gimple-expr.cc:85 with   |at gimple-expr.cc:85 with
   |-O2 -fno-tree-forwprop  |-O2  -fno-vect-cost-model
   |-fvect-cost-model=unlimited |

--- Comment #3 from Andrew Pinski  ---
  _20 = {t1_6, _10};
  vect_patt_12.5_22 = { 254, 255 } + _20;
  vect_t1_7.4_21 = { 254, 255 } - _20;


_10 is not defined anywhere.

[Bug tree-optimization/114799] [14 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -O2 -fno-tree-forwprop -f

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114799

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-04-22

--- Comment #2 from Andrew Pinski  ---
Confirmed.

[Bug tree-optimization/114799] [14 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -O2 -fno-tree-forwprop -f

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114799

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0

[Bug tree-optimization/114799] [14 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -O2 -fno-tree-forwprop -f

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114799

--- Comment #1 from Andrew Pinski  ---
Created attachment 58005
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58005=edit
Reduced further

Just need `-O3  -fno-vect-cost-model` with this one.

[Bug tree-optimization/114799] New: [14 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -O2 -fno-tree-forwpr

2024-04-21 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114799

Bug ID: 114799
   Summary: [14 Regression] ICE: tree check: expected class
'type', have 'exceptional' (error_mark) in
useless_type_conversion_p, at gimple-expr.cc:85 with
-O2 -fno-tree-forwprop -fvect-cost-model=unlimited
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 58004
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58004=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-forwprop -fvect-cost-model=unlimited
testcase.c -Wno-psabi
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:17:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.cc:85
   17 | foo (void)
  | ^~~
0x894e6f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9006
0x77ef52 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3779
0x77ef52 useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.cc:85
0x155c516 verify_gimple_assign_single
/repo/gcc-trunk/gcc/tree-cfg.cc:4791
0x155c516 verify_gimple_assign
/repo/gcc-trunk/gcc/tree-cfg.cc:4843
0x155c516 verify_gimple_stmt
/repo/gcc-trunk/gcc/tree-cfg.cc:5108
0x155fd01 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5603
0x13ced14 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x13cf26e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-10062-20240422092604-gec78916bb37-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-10062-20240422092604-gec78916bb37-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240422 (experimental) (GCC)

[Bug libfortran/114304] [13/14 Regression] libgfortran I/O – bogus "Semicolon not allowed as separator with DECIMAL='point'"

2024-04-21 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114304

Jerry DeLisle  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #35 from Jerry DeLisle  ---
Fixed on 13 and mainline (14)

[Bug fortran/105473] semicolon allowed when list-directed read integer with decimal='point'

2024-04-21 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105473

Jerry DeLisle  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #40 from Jerry DeLisle  ---
Fixed on 13 and mainline (14)

[Bug fortran/105473] semicolon allowed when list-directed read integer with decimal='point'

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

--- Comment #39 from GCC Commits  ---
The releases/gcc-13 branch has been updated by Jerry DeLisle
:

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

commit r13-8640-gb55a35bcc80a7402576556c2f9d161229fb220ef
Author: Jerry DeLisle 
Date:   Sun Apr 21 20:50:26 2024 -0700

libfortran: Fix handling of formatted separators.

Backport from mainline.

PR libfortran/114304
PR libfortran/105473

libgfortran/ChangeLog:

* io/list_read.c (eat_separator): Add logic to handle spaces
preceding a comma or semicolon such that that a 'null' read
occurs without error at the end of comma or semicolon
terminated input lines. Add check and error message for ';'.
Accept tab as alternative to space.
(list_formatted_read_scalar): Treat comma as a decimal point
when specified by the decimal mode on the first item.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr105473.f90: Modify for revised checks.
* gfortran.dg/pr114304-2.f90: New test.
* gfortran.dg/pr114304.f90: New test.

[Bug libfortran/114304] [13/14 Regression] libgfortran I/O – bogus "Semicolon not allowed as separator with DECIMAL='point'"

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

--- Comment #34 from GCC Commits  ---
The releases/gcc-13 branch has been updated by Jerry DeLisle
:

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

commit r13-8640-gb55a35bcc80a7402576556c2f9d161229fb220ef
Author: Jerry DeLisle 
Date:   Sun Apr 21 20:50:26 2024 -0700

libfortran: Fix handling of formatted separators.

Backport from mainline.

PR libfortran/114304
PR libfortran/105473

libgfortran/ChangeLog:

* io/list_read.c (eat_separator): Add logic to handle spaces
preceding a comma or semicolon such that that a 'null' read
occurs without error at the end of comma or semicolon
terminated input lines. Add check and error message for ';'.
Accept tab as alternative to space.
(list_formatted_read_scalar): Treat comma as a decimal point
when specified by the decimal mode on the first item.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr105473.f90: Modify for revised checks.
* gfortran.dg/pr114304-2.f90: New test.
* gfortran.dg/pr114304.f90: New test.

[Bug ipa/114790] [11/12/13/14 regression] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

Sam James  changed:

   What|Removed |Added

Summary|ICE when building   |[11/12/13/14 regression]
   |intel-compute-runtime   |ICE when building
   |(error: direct call to ...  |intel-compute-runtime
   |speculative call sequence   |(error: direct call to ...
   |has no speculative flag)|speculative call sequence
   ||has no speculative flag)

--- Comment #11 from Sam James  ---
10 wfm (doesn't ICE) on my testcase, 11+ doesn't

[Bug ipa/114790] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #10 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #9)
> Created attachment 58003 [details]
> t2.cc
> 
> `gcc -Wfatal-errors -fvisibility=hidden -shared t1.cc t2.cc -o t.so -fPIC
> -O2 -flto=1 -flto-partition=1to1 -w`

Note this testcase also violates ODR due to
APITracerContextImp/APITracerContext having different virtual functions.

[Bug ipa/114790] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #9 from Andrew Pinski  ---
Created attachment 58003
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58003=edit
t2.cc

`gcc -Wfatal-errors -fvisibility=hidden -shared t1.cc t2.cc -o t.so -fPIC -O2
-flto=1 -flto-partition=1to1 -w`

[Bug ipa/114790] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #8 from Andrew Pinski  ---
Created attachment 58002
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58002=edit
t1.cc

[Bug ipa/114790] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #7 from Sam James  ---
`g++-14 -fPIC -O2 -flto -flto-partition=1to1 -shared
-Wl,--version-script=ze.exports reduced-a.ii reduced-b.ii`

it violates ODR though:
```
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/ccvUhonb.o (symbol from plugin): in function `std::aa':
(.text+0x0): multiple definition of `L0::pGlobalAPITracerContextImp';
/tmp/cci2r56P.o (symbol from plugin):(.text+0x0): first defined here
```

[Bug ipa/114790] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #6 from Sam James  ---
Created attachment 58001
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58001=edit
reduced-b.ii

[Bug ipa/114790] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2024-04-21 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #5 from Sam James  ---
Created attachment 58000
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58000=edit
reduced-a.b

[Bug analyzer/114798] New: ICE: in convert_svalue_from_summary_1, at analyzer/call-summary.cc:290

2024-04-21 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114798

Bug ID: 114798
   Summary: ICE: in convert_svalue_from_summary_1, at
analyzer/call-summary.cc:290
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/5GE3xG7zM

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202404101100/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202404101100/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202404101100
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240410 (experimental) (GCC) 

git version: 0774240b4df9a9bc48ce33a9625788e402498f5a
***
Program:
$ cat mutant.c
_Bool b() {}
void c() {
  int d;
  void check(_Bool a) {
_Bool e;
if (a && e)
  __builtin_abort();
_Bool f = b(d);
if (a && f)
  __builtin_abort();
  }
  check(1);
  check(0);
}

***
Command Lines:
$ gcc -fanalyzer -fanalyzer-call-summaries -c mutant.c
during IPA pass: analyzer
mutant.c: In function ‘c’:
mutant.c:12:3: internal compiler error: in convert_svalue_from_summary_1, at
analyzer/call-summary.cc:290
   12 |   check(1);
  |   ^~~~
0x933c67 ana::call_summary_replay::convert_svalue_from_summary_1(ana::svalue
const*)
../../gcc/gcc/analyzer/call-summary.cc:290
0x217b2aa ana::call_summary_replay::convert_svalue_from_summary(ana::svalue
const*)
../../gcc/gcc/analyzer/call-summary.cc:236
0x219584b ana::replay_fact_visitor::on_fact(ana::svalue const*, tree_code,
ana::svalue const*)
../../gcc/gcc/analyzer/constraint-manager.cc:3273
0x2189728 ana::constraint_manager::for_each_fact(ana::fact_visitor*) const
../../gcc/gcc/analyzer/constraint-manager.cc:3240
0x2189958
ana::constraint_manager::replay_call_summary(ana::call_summary_replay&,
ana::constraint_manager const&)
../../gcc/gcc/analyzer/constraint-manager.cc:3307
0x1491770 ana::region_model::replay_call_summary(ana::call_summary_replay&,
ana::region_model const&)
../../gcc/gcc/analyzer/region-model.cc:5640
0x14723eb ana::program_state::replay_call_summary(ana::call_summary_replay&,
ana::program_state const&)
../../gcc/gcc/analyzer/program-state.cc:1635
0x1458743 ana::call_summary_edge_info::update_state(ana::program_state*,
ana::exploded_edge const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/engine.cc:1633
0x1450d9a ana::exploded_graph::process_node(ana::exploded_node*)
../../gcc/gcc/analyzer/engine.cc:4241
0x145166a ana::exploded_graph::process_worklist()
../../gcc/gcc/analyzer/engine.cc:3516
0x1453c4b ana::impl_run_checkers(ana::logger*)
../../gcc/gcc/analyzer/engine.cc:6210
0x1454bb6 ana::run_checkers()
../../gcc/gcc/analyzer/engine.cc:6308
0x1443a98 execute
../../gcc/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/114795] internal compiler error: in finish_member_declaration after module import in gcc 14.0.1 snapshot

2024-04-21 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114795

Nathaniel Shead  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=114600,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=99000
 CC||nshead at gcc dot gnu.org

--- Comment #3 from Nathaniel Shead  ---
Similarly to PR114600 (and PR99000 and maybe some others?) this is because we
don't support textual redefinitions yet (`#include` after `import` naming the
same things). See https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Modules.html:


G++’s modules support is not complete. Other than bugs, the known missing
pieces are: 

[...]

Textual merging of reachable GM entities

Entities may be multiply defined across different header-units. These must
be de-duplicated, and this is implemented across imports, or when an import
redefines a textually-defined entity. However the reverse is not
implemented—textually redefining an entity that has been defined in an imported
header-unit. A redefinition error is emitted.


A workaround is to ensure that `#include` always goes before `import`, or to
use a header module here rather than `#include`.

FWIW this particular ICE is because we hit this assertion:

  /* Don't add decls after definition.  */
  gcc_assert (TYPE_BEING_DEFINED (current_class_type)
  /* We can add lambda types when late parsing default
 arguments.  */
  || LAMBDA_TYPE_P (TREE_TYPE (decl)));

but the class has already been defined earlier, by the import.


The other issue here is that we didn't discard the entire GMF here, I suppose
possibly because of a similar issue as described in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114630#c2.

[Bug target/85048] [missed optimization] vector conversions

2024-04-21 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85048

Hongtao Liu  changed:

   What|Removed |Added

 CC||liuhongt at gcc dot gnu.org

--- Comment #14 from Hongtao Liu  ---
(In reply to Matthias Kretz (Vir) from comment #13)
> Should I open a new PR for the remaining ((u)int64, 16) <-> (float, 16)
> conversions?
> 
> https://godbolt.org/z/x3xPMYKj3
> 
> Note that __builtin_convertvector produces the code we want.
> 

With -mprefer-vector-width=512, GCC generate produces the same code.
Default tuning for -march=skylake-avx512 is -mprefer-vector-width=256.

[Bug c++/114795] internal compiler error: in finish_member_declaration after module import in gcc 14.0.1 snapshot

2024-04-21 Thread porten at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114795

--- Comment #2 from porten at kde dot org ---
The ICE is still there with current master
(f17d31e709af9b2d488adecd6cd040dfc1f23b04). The test case provided in bug
#114600 works for me now, though. So similar but seemingly no duplicate after
all.

[Bug c++/114795] internal compiler error: in finish_member_declaration after module import in gcc 14.0.1 snapshot

2024-04-21 Thread porten at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114795

--- Comment #1 from porten at kde dot org ---
Looking through the other c++-modules reports, I saw that someone reduced a
similar test case to an ICE in comment #3:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114600#c3  Therefore this bug
could be a duplicate of #114600.

[Bug c++/97202] GCC reports an error: expected unqualified-id before ‘short’

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97202

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0

[Bug tree-optimization/114792] [14 Regression] ICE on valid code at -O1 with "-fno-tree-ccp -fno-tree-copy-prop" on x86_64-linux-gnu: in get_loop_body, at cfgloop.cc:903

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114792

--- Comment #2 from Andrew Pinski  ---
Confirmed.

[Bug tree-optimization/114792] [14 Regression] ICE on valid code at -O1 with "-fno-tree-ccp -fno-tree-copy-prop" on x86_64-linux-gnu: in get_loop_body, at cfgloop.cc:903

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114792

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org
   Target Milestone|--- |14.0

[Bug rtl-optimization/114796] [11/12/13/14 Regression] wrong code at -O2 with "-fno-tree-fre -fno-inline -fselective-scheduling2" on x86_64-linux-gnu

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114796

Andrew Pinski  changed:

   What|Removed |Added

  Component|tree-optimization   |rtl-optimization
   Target Milestone|--- |11.5

[Bug tree-optimization/114797] Missed optimization : fail to merge memset with unrelated clobber

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114797

--- Comment #3 from Andrew Pinski  ---
(In reply to XChy from comment #2)
> It looks like for completely overlapped memset, it's merged:
> https://godbolt.org/z/4r7Eqr1Ee
> With clobber, that's not the case: https://godbolt.org/z/8jhaEbKqo

Yes for the secondary memset that is completely overlapping can be removed.

[Bug tree-optimization/114796] [11/12/13/14 Regression] wrong code at -O2 with "-fno-tree-fre -fno-inline -fselective-scheduling2" on x86_64-linux-gnu

2024-04-21 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114796

H.J. Lu  changed:

   What|Removed |Added

Summary|wrong code at -O2 with  |[11/12/13/14 Regression]
   |"-fno-tree-fre -fno-inline  |wrong code at -O2 with
   |-fselective-scheduling2" on |"-fno-tree-fre -fno-inline
   |x86_64-linux-gnu|-fselective-scheduling2" on
   ||x86_64-linux-gnu
   Last reconfirmed||2024-04-21
 CC||abel at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
Version|unknown |14.0
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
This is caused by r9-6789.

[Bug tree-optimization/114797] Missed optimization : fail to merge memset with unrelated clobber

2024-04-21 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114797

--- Comment #2 from XChy  ---
It looks like for completely overlapped memset, it's merged:
https://godbolt.org/z/4r7Eqr1Ee
With clobber, that's not the case: https://godbolt.org/z/8jhaEbKqo

[Bug tree-optimization/49872] Missed optimization: Could coalesce neighboring memsets

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49872

Andrew Pinski  changed:

   What|Removed |Added

 CC||xxs_chy at outlook dot com

--- Comment #4 from Andrew Pinski  ---
*** Bug 114797 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/114797] Missed optimization : fail to merge memset with unrelated clobber

2024-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114797

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Andrew Pinski  ---
GCC does not even merge without an unrelated clobber yet.

*** This bug has been marked as a duplicate of bug 49872 ***

[Bug tree-optimization/114797] New: Missed optimization : fail to merge memset with unrelated clobber

2024-04-21 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114797

Bug ID: 114797
   Summary: Missed optimization : fail to merge memset with
unrelated clobber
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Godbolt link: https://godbolt.org/z/E581jvaPs

Code like:
```
void src(char* config){
char stack[208];
memset(stack, 0, 184);
*config = 0;
memset(stack + 184, 0, 8);
use(stack);
}
```

can be transformed to

```
void tgt(char* config){
char stack[208];
memset(stack, 0, 192);
*config = 0;
use(stack);
}
```

GCC doesn't merge them even both memsets overlap:
https://godbolt.org/z/ffc6b8zqs

[Bug fortran/103471] Missed no IMPLICIT type errors

2024-04-21 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471

Paul Thomas  changed:

   What|Removed |Added

Summary|[11/12/13/14 Regression]|Missed no IMPLICIT type
   |ICE in  |errors
   |gfc_typenode_for_spec, at   |
   |fortran/trans-types.c:1114  |

--- Comment #12 from Paul Thomas  ---
The regression has been cured in the above commit and some of the missed error
messages have been fixed.

Compared with the submission to the list and discussed with Harald Anlauf, an
extra chunk has been added in resolve.cc(resolve_actual_arglist) to catch
untyped actual arguments.

See the testcase commented out line for an example interference between
different statements with untyped symbols.

I am keeping this one open having changed the summary.

Paul

[Bug tree-optimization/114796] New: wrong code at -O2 with "-fno-tree-fre -fno-inline -fselective-scheduling2" on x86_64-linux-gnu

2024-04-21 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114796

Bug ID: 114796
   Summary: wrong code at -O2 with "-fno-tree-fre -fno-inline
-fselective-scheduling2" on x86_64-linux-gnu
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

This seems quite long-latent and affects all versions 9.* and later. 

Compiler Explorer: https://godbolt.org/z/nKx6f4hjK

[526] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240421 (experimental) (GCC) 
[527] % 
[527] % gcctk -O0 small.c
[528] % ./a.out
[529] % 
[529] % gcctk -O2 -fno-tree-fre -fno-inline -fselective-scheduling2 small.c
[530] % ./a.out
Aborted
[531] % 
[531] % cat small.c
int printf(const char *, ...);
int a, b, c = -3, h, j, k;
struct d {
  int e;
  char f;
  char g;
};
int i, l, m;
char n[10][9] = {{1}};
struct d o = {1,0,0};
unsigned p;
void q(int s) { b = a; }
void r() {
  k = 0;
  while (k)
while (l)
  while (i)
if (m)
  while (1)
;
  for (; p < 1; p++) {
if (j) {
  q(n[j][c]);
  if (h)
printf("\n");
}
n[p][k] = 1;
  }
}
int main() {
  r();
  if (o.g != 0)
__builtin_abort();
  return 0;
}

[Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114

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

--- Comment #11 from GCC Commits  ---
The master branch has been updated by Paul Thomas :

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

commit r14-10059-gf17d31e709af9b2d488adecd6cd040dfc1f23b04
Author: Paul Thomas 
Date:   Sun Apr 21 17:24:24 2024 +0100

Fortran: Detect 'no implicit type' error in right place [PR103471]

2024-04-21  Paul Thomas  

gcc/fortran
PR fortran/103471
* resolve.cc (resolve_actual_arglist): Catch variables silently
set as untyped, resetting the flag so that gfc_resolve_expr can
generate the no implicit type error.
(gfc_resolve_index_1): Block index expressions of unknown type
from being converted to default integer, avoiding the fatal
error in trans-decl.cc.
* symbol.cc (gfc_set_default_type): Remove '(symbol)' from the
'no IMPLICIT type' error message.
* trans-decl.cc (gfc_get_symbol_decl): Change fatal error locus
to that of the symbol declaration.
(gfc_trans_deferred_vars): Remove two trailing tabs.

gcc/testsuite/
PR fortran/103471
* gfortran.dg/pr103471.f90: New test.

[Bug tree-optimization/114793] [14 Regression] wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs)

2024-04-21 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114793

--- Comment #3 from H.J. Lu  ---
(In reply to Zhendong Su from comment #1)
> The following reproducer is different, but perhaps is the same or related.
> 
> Compiler Explorer: https://godbolt.org/z/411rzMP1n
> 
> [588] % gcctk -v
> Using built-in specs.
> COLLECT_GCC=gcctk
> COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/
> x86_64-pc-linux-gnu/14.0.1/lto-wrapper
> Target: x86_64-pc-linux-gnu
> Configured with: ../gcc-trunk/configure --disable-bootstrap
> --enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
> --enable-sanitizers --enable-languages=c,c++ --disable-werror
> --enable-multilib
> Thread model: posix
> Supported LTO compression algorithms: zlib
> gcc version 14.0.1 20240421 (experimental) (GCC) 
> [589] % 
> [589] % gcctk -O1 -fno-tree-forwprop -fselective-scheduling2
> -fschedule-insns2 -fsel-sched-pipelining small.c
> [590] % ./a.out
> Aborted
> [591] % 
> [591] % cat small.c
> int printf(const char *, ...);
> int a, d, g, h;
> volatile int b = 1;
> static unsigned c = 1;
> char e, f = 1, i;
> static int j() {
>   int k, l = g, m = 1 << l, n = -e, o = -1 % ((f && 1) ^ i), p = ~n - o;
>   if (m) {
> int q, s, t, r = 1 % (((1 % f) & (~e | c)) ^ b);
> q = f;
> s = i;
> t = e;
> f = -b;
> k = f;
> d = -1;
>   u:
> e = 0 & b;
> if (i > f)
>   if (!b)
> goto v;
> if (d > t)
>   __builtin_abort();
> if (b < 1 || !d || !c) {
>   printf("%d\n", i);
>   f = ((i | b) & (k - r)) << (e << ~t ^ q) << s;
>   goto u;
> }
> if (i)
>   f = q;
>   v:
> i = n & o & l;
> printf("%ld\n", (long)t);
>   }
>   i = p;
>   return h;
> }
> int main() {
>   for (; a < 3; a++)
> j();
>   return 0;
> }

This is caused by r14-2524.

[Bug tree-optimization/114793] wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs)

2024-04-21 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114793

H.J. Lu  changed:

   What|Removed |Added

 CC||jh at suse dot cz
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-04-21
Version|unknown |14.0

--- Comment #2 from H.J. Lu  ---
(In reply to Zhendong Su from comment #0)
> It seems to be a recent regression as it does not reproduce with 13.2 and
> earlier.
> 
> Compiler Explorer: https://godbolt.org/z/b3cc1MqP9
> 
> [538] % gcctk -v
> Using built-in specs.
> COLLECT_GCC=gcctk
> COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/
> x86_64-pc-linux-gnu/14.0.1/lto-wrapper
> Target: x86_64-pc-linux-gnu
> Configured with: ../gcc-trunk/configure --disable-bootstrap
> --enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
> --enable-sanitizers --enable-languages=c,c++ --disable-werror
> --enable-multilib
> Thread model: posix
> Supported LTO compression algorithms: zlib
> gcc version 14.0.1 20240421 (experimental) (GCC) 
> [539] % 
> [539] % gcctk -O0 small.c
> [540] % ./a.out
> [541] % 
> [541] % gcctk -O1 -fschedule-insns2 -fselective-scheduling2 small.c
> [542] % timeout -s 9 10 ./a.out
> Killed
> [543] % 
> [543] % cat small.c
> int printf(const char *, ...);
> volatile int a;
> int b, c, d = 1, e, f;
> int main() {
>   int g = 1;
>   for (; b; b -= d)
> g = e;
>   for (; c < 2; c++) {
> if (g) {
>   if (!d)
> printf("%d", f);
>   continue;
> }
> a;
>   }
>   return 0;
> }

This is caused by r14-2712.

[Bug tree-optimization/114792] ICE on valid code at -O1 with "-fno-tree-ccp -fno-tree-copy-prop" on x86_64-linux-gnu: in get_loop_body, at cfgloop.cc:903

2024-04-21 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114792

H.J. Lu  changed:

   What|Removed |Added

   Last reconfirmed||2024-04-21
 CC||jh at suse dot cz
 Ever confirmed|0   |1
Version|unknown |14.0
 Status|UNCONFIRMED |NEW

--- Comment #1 from H.J. Lu  ---
It is caused by r14-301.

[Bug c++/114795] New: internal compiler error: in finish_member_declaration after module import in gcc 14.0.1 snapshot

2024-04-21 Thread porten at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114795

Bug ID: 114795
   Summary: internal compiler error: in finish_member_declaration
after module import in gcc 14.0.1 snapshot
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: porten at kde dot org
  Target Milestone: ---

This is with a gcc/g++ build created locally from the published snapshot
package gcc-14-20240414.tar.xz.

-- compiler info --
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/gcc-14/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/porten/tmp/gcc-14-20240414/configure --disable-multilib
--prefix=/opt/gcc-14 --enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240414 (experimental) (GCC)

-- Command triggering the bug --

g++ -std=c++2a -fmodules-ts -c url.cpp queue.cpp

-- url.cpp --

module;

#include 

export module url;

-- queue.cpp --

import url;

#include 

-- output -

In file included from /opt/gcc-14/include/c++/14.0.1/concepts:46,
 from /opt/gcc-14/include/c++/14.0.1/compare:40,
 from /opt/gcc-14/include/c++/14.0.1/array:38,
 from /opt/gcc-14/include/c++/14.0.1/format:43,
 from queue.cpp:3:
/opt/gcc-14/include/c++/14.0.1/type_traits:89:36: error: template definition of
non-template ‘constexpr const _Tp std::integral_constant<_Tp, __v>::value’
   89 |   static constexpr _Tp value = __v;
  |^~~
[ ... 7000 lines with compiler errors ... ]
/opt/gcc-14/include/c++/14.0.1/optional:265:30: internal compiler error: in
finish_member_declaration, at cp/semantics.cc:3840
  265 |   _Storage<_Stored_type> _M_payload;
  |  ^~
0x7fa7e1 finish_member_declaration(tree_node*)
/home/porten/tmp/gcc-14-20240414/gcc/cp/semantics.cc:3840
0xc28be5 cp_parser_member_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:28497
0xbeef63 cp_parser_member_specification_opt
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:27840
0xbeef63 cp_parser_class_specifier
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:26845
0xbeef63 cp_parser_type_specifier
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:20064
0xbf094d cp_parser_decl_specifier_seq
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:16590
0xc25cfa cp_parser_single_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:33143
0xc2619c cp_parser_template_declaration_after_parameters
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:32799
0xc26a80 cp_parser_explicit_template_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:33072
0xc2b599 cp_parser_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:15502
0xc29c99 cp_parser_toplevel_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:15594
0xc29c99 cp_parser_declaration_seq_opt
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:15345
0xc2a13b cp_parser_namespace_body
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:22128
0xc2a13b cp_parser_namespace_definition
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:22106
0xc2b896 cp_parser_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:15553
0xc2bf8a cp_parser_toplevel_declaration
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:15594
0xc2bf8a cp_parser_translation_unit
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:5279
0xc2bf8a c_parse_file()
/home/porten/tmp/gcc-14-20240414/gcc/cp/parser.cc:51268
0xd7ae41 c_common_parse_file()
/home/porten/tmp/gcc-14-20240414/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/114036] Test failure of gcov-14.c on darwin

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

--- Comment #7 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
:

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

commit r12-10379-ged046c2cc0f0a2d00cc77e5e9ce5d8f71e2278c6
Author: Iain Sandoe 
Date:   Sun Mar 31 11:27:53 2024 +0100

testsuite, Darwin: Allow for an undefined symbol [PR114036].

Darwin's linker defaults to requiring all symbols to be defined at
static link time (unless specifically noted or dynamic lookuo is
enabled).

For this test, we just need to note that the symbol is expected to
be undefined.

PR testsuite/114036

gcc/testsuite/ChangeLog:

* gcc.misc-tests/gcov-14.c: Allow for 'Foo' to be undefined
on Darwin link lines.

Signed-off-by: Iain Sandoe 
(cherry picked from commit ad8e34eaa870608e2b07b4e7147e6ef2944bb8b5)

[Bug target/112397] Two persistent libstdc++ test failures on x86_64-apple-darwin

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

--- Comment #13 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:77f17e405a0669db9a6c8af69bde6eb1170f48bd

commit r12-10376-g77f17e405a0669db9a6c8af69bde6eb1170f48bd
Author: Iain Sandoe 
Date:   Thu Feb 8 17:54:31 2024 +

libstdc++, Darwin: Handle a linker warning [PR112397].

Darwin's linker warns when we make a direct branch to code that is
in a weak definition (citing that if a different implementation of
the weak function is chosen by the dynamic linker this would be an
error).

As the analysis in the PR shows, this can happen when we have hot/
cold partitioning and there is an error path that is primarily cold
but makes use of epilogue code in the hot section.  In this simple
case, we can easily deduce that the code is in fact safe; however
that is not something we can realistically implement in the linker.

Since the user-replaceable allocators are implemented using weak
definitions, this is a warning that is frequently flagged up in both
the testsuite and end-user code.

The chosen solution here is to suppress the hot/cold partitioning for
these cases (it is unlikely to impact performance much c.f. the
actual allocation).

PR target/112397

libstdc++-v3/ChangeLog:

* configure: Regenerate.
* configure.ac: Detect if we are building for Darwin.
* libsupc++/Makefile.am: If we are building for Darwin, then
suppress hot/cold partitioning for the array allocators.
* libsupc++/Makefile.in: Regenerated.

Signed-off-by: Iain Sandoe 
Co-authored-by: Jonathan Wakely 
(cherry picked from commit 1609fdff16f17ead37666f6d0e801800ee3d04d2)

[Bug target/114049] gcc.dg/framework-1.c FAILs with Xcode 15.3 beta 3

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

--- Comment #12 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:4c8d37badaa42e85218eb9b89aef3e4f6cf4486e

commit r12-10375-g4c8d37badaa42e85218eb9b89aef3e4f6cf4486e
Author: Iain Sandoe 
Date:   Mon Mar 18 10:06:44 2024 +

testsuite, Darwin: Use the IOKit framework in framework-1.c [PR114049].

The intent of the test is to show that we find a framework that
is installed in /System/Library/Frameworks when the user has added
a '-F' option.  The trick is to choose some header that is present
for all the Darwin versions we support and that does not contain any
content we cannot parse.  We had been using the Kernel framework for
this, but recent SDK versions have revealed that this is not suitable.

Replacing with a use of IOKit.

PR target/114049

gcc/testsuite/ChangeLog:

* gcc.dg/framework-1.c: Use an IOKit header instead of a
Kernel one.

Signed-off-by: Iain Sandoe 
(cherry picked from commit 4adb1a5839e7a3310a127c1776f1f95d7edaa6ff)

[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2024-04-21 Thread dilyan.palauzov at aegee dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #40 from Дилян Палаузов  ---
Makefile.in contains now:

@if gcc-bootstrap
@unless target-libbacktrace-bootstrap
all-target-libgo: maybe-all-target-libbacktrace
@endunless target-libbacktrace-bootstrap
@endif gcc-bootstrap

@unless gcc-bootstrap
all-target-libgo: maybe-all-target-libbacktrace
@endunless gcc-bootstrap

Isn’t this the same as just:

all-target-libgo: maybe-all-target-libbacktrace

Or when is gcc-bootstrap true and target-libbacktrace-bootstrap false?

[Bug testsuite/112297] Failure of pr100936.c on x86_64-apple-darwin21

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

--- Comment #5 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:0eb6f8874047f7e7f13027aaac14d3de276c5e69

commit r12-10370-g0eb6f8874047f7e7f13027aaac14d3de276c5e69
Author: Francois-Xavier Coudert 
Date:   Mon Dec 11 09:26:23 2023 +0100

Testsuite: restrict test to nonpic targets

The test is currently failing on x86_64-apple-darwin.

gcc/testsuite/ChangeLog:

PR testsuite/112297
* gcc.target/i386/pr100936.c: Require nonpic target.

(cherry picked from commit 02f562484c17522d79a482ac702a5fa3c2dfdd10)

[Bug target/114794] [avr] Speed up udivmodqi4

2024-04-21 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114794

Georg-Johann Lay  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED
   Target Milestone|--- |13.3

--- Comment #3 from Georg-Johann Lay  ---
Fixed in v13.3+

[Bug target/114794] [avr] Speed up udivmodqi4

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

--- Comment #2 from GCC Commits  ---
The releases/gcc-13 branch has been updated by Georg-Johann Lay
:

https://gcc.gnu.org/g:7bd8428da72a0a1d3bef4e50be4b60b981ed540d

commit r13-8638-g7bd8428da72a0a1d3bef4e50be4b60b981ed540d
Author: Georg-Johann Lay 
Date:   Sun Apr 21 14:33:50 2024 +0200

AVR: target/114794 - Tweak __udivmodqi4

libgcc/
PR target/114794
* config/avr/lib1funcs.S (__udivmodqi4): Tweak.

(cherry picked from commit a44d16efa7a508f8b8f303417d0714c39f159725)

[Bug target/114794] [avr] Speed up udivmodqi4

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

--- Comment #1 from GCC Commits  ---
The master branch has been updated by Georg-Johann Lay :

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

commit r14-10058-ga44d16efa7a508f8b8f303417d0714c39f159725
Author: Georg-Johann Lay 
Date:   Sun Apr 21 14:33:50 2024 +0200

AVR: target/114794 - Tweak __udivmodqi4

libgcc/
PR target/114794
* config/avr/lib1funcs.S (__udivmodqi4): Tweak.

[Bug target/114794] [avr] Speed up udivmodqi4

2024-04-21 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114794

Georg-Johann Lay  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Priority|P3  |P5
 Target||avr

[Bug target/114794] New: [avr] Speed up udivmodqi4

2024-04-21 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114794

Bug ID: 114794
   Summary: [avr] Speed up udivmodqi4
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

udivmodqi4 is slower than it could be.

[Bug tree-optimization/114793] wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs)

2024-04-21 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114793

--- Comment #1 from Zhendong Su  ---
The following reproducer is different, but perhaps is the same or related.

Compiler Explorer: https://godbolt.org/z/411rzMP1n

[588] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240421 (experimental) (GCC) 
[589] % 
[589] % gcctk -O1 -fno-tree-forwprop -fselective-scheduling2 -fschedule-insns2
-fsel-sched-pipelining small.c
[590] % ./a.out
Aborted
[591] % 
[591] % cat small.c
int printf(const char *, ...);
int a, d, g, h;
volatile int b = 1;
static unsigned c = 1;
char e, f = 1, i;
static int j() {
  int k, l = g, m = 1 << l, n = -e, o = -1 % ((f && 1) ^ i), p = ~n - o;
  if (m) {
int q, s, t, r = 1 % (((1 % f) & (~e | c)) ^ b);
q = f;
s = i;
t = e;
f = -b;
k = f;
d = -1;
  u:
e = 0 & b;
if (i > f)
  if (!b)
goto v;
if (d > t)
  __builtin_abort();
if (b < 1 || !d || !c) {
  printf("%d\n", i);
  f = ((i | b) & (k - r)) << (e << ~t ^ q) << s;
  goto u;
}
if (i)
  f = q;
  v:
i = n & o & l;
printf("%ld\n", (long)t);
  }
  i = p;
  return h;
}
int main() {
  for (; a < 3; a++)
j();
  return 0;
}

[Bug tree-optimization/114793] New: wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs)

2024-04-21 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114793

Bug ID: 114793
   Summary: wrong code at -O1 with "-fschedule-insns2
-fselective-scheduling2" on x86_64-linux-gnu (the
generated code hangs)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It seems to be a recent regression as it does not reproduce with 13.2 and
earlier.

Compiler Explorer: https://godbolt.org/z/b3cc1MqP9

[538] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240421 (experimental) (GCC) 
[539] % 
[539] % gcctk -O0 small.c
[540] % ./a.out
[541] % 
[541] % gcctk -O1 -fschedule-insns2 -fselective-scheduling2 small.c
[542] % timeout -s 9 10 ./a.out
Killed
[543] % 
[543] % cat small.c
int printf(const char *, ...);
volatile int a;
int b, c, d = 1, e, f;
int main() {
  int g = 1;
  for (; b; b -= d)
g = e;
  for (; c < 2; c++) {
if (g) {
  if (!d)
printf("%d", f);
  continue;
}
a;
  }
  return 0;
}

[Bug tree-optimization/114792] New: ICE on valid code at -O1 with "-fno-tree-ccp -fno-tree-copy-prop" on x86_64-linux-gnu: in get_loop_body, at cfgloop.cc:903

2024-04-21 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114792

Bug ID: 114792
   Summary: ICE on valid code at -O1 with "-fno-tree-ccp
-fno-tree-copy-prop" on x86_64-linux-gnu: in
get_loop_body, at cfgloop.cc:903
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a recent regression and does not reproduce with 13.2. 

Compiler Explorer: https://godbolt.org/z/zzdjrb599


[522] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240421 (experimental) (GCC) 
[523] % 
[523] % gcctk -O1 -fno-tree-ccp -fno-tree-copy-prop small.c
during GIMPLE pass: ch
small.c: In function ‘main’:
small.c:2:5: internal compiler error: in get_loop_body, at cfgloop.cc:903
2 | int main() {
  | ^~~~
0x7926fd get_loop_body(loop const*)
../../gcc-trunk/gcc/cfgloop.cc:903
0xbfbce9 unloop(loop*, bool*, bitmap_head*)
../../gcc-trunk/gcc/cfgloopmanip.cc:1014
0x12ee996 unloop_loops(vec&, vec&, vec&, bitmap_head*, bool*)
../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:688
0x12dfc84 copy_headers
../../gcc-trunk/gcc/tree-ssa-loop-ch.cc:1158
0x12e02da execute
../../gcc-trunk/gcc/tree-ssa-loop-ch.cc:1179
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[524] % 
[524] % cat small.c
int a;
int main() {
  int b = -1, c;
  for (; b >= 0; b++) {
for (c = 0; c; c++) {
L:
  while (a)
if (a)
  goto L;
}
  }
  return 0;
}

[Bug ada/114708] [12/13/14 regression] internal error on access to an incomplete formal in generic package

2024-04-21 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114708

--- Comment #3 from Eric Botcazou  ---
This appears to be sufficient:

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 04d114694ab..f81380846e0 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -6076,6 +6076,12 @@ package body Exp_Util is

   Utyp := Underlying_Type (Base_Type (Utyp));

+  --  Handle incomplete types
+
+  if No (Utyp) then
+ return Empty;
+  end if;
+
   --  Deal with untagged derivation of private views. If the parent is
   --  now known to be protected, the finalization routine is the one
   --  defined on the corresponding record of the ancestor (corresponding

[Bug ada/114710] temporary object finalized too late

2024-04-21 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114710

Eric Botcazou  changed:

   What|Removed |Added

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

--- Comment #2 from Eric Botcazou  ---
I'll have a look.

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-21 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791

--- Comment #5 from Urs Janßen  ---
-Wanalyzer-fd-leak has the same issue, no warning given for:

#define _DEFAULT_SOURCE 1
#include 
#include 
#include 
#include 
#include 

int main(void);

int main(void) {
int fd = -1;
int i = 0;
static const char *list[] = { "/tmp/", "/tmp/a", "/tmp/b", NULL };
struct stat st;

while (list[i] != NULL) {
if ((fd = open(list[i++], O_RDONLY)) != -1) {
if (fstat(fd, ) != -1) {
if ((st.st_mode & (S_IFREG | S_IFLNK)) && st.st_size > 0L)
break;
}
#ifdef NO_FILE_LEAK
close(fd);
fd = -1;
#endif /* NO_FILE_LEAK */
}
}

if (fd != -1)
close(fd);
}