[Bug tree-optimization/97711] Failure to optimise "x & 1 ? x - 1 : x" to "x & -2"

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97711

--- Comment #2 from Andrew Pinski  ---
So GCC already converts the following two functions at the gimple level:
  int f1 (int x) { return x - (x & 1); }
  char *g1 (char *x) { return x - ((__UINTPTR_TYPE__) x & 1); }
- CUT 
Even on the RTL level too, I Noticed that because the original testcase does
the correct thing for aarch64, why it is not done for x86_64 I don't know.


Anyways what we could do is take:
  if (_2 != 0)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 536870913]:
  iftmp.1_5 = x_4(D) + 18446744073709551615;

   [local count: 1073741824]:
  # iftmp.1_3 = PHI 

And convert that too:
iftmp.1_3 = x - (type)(_2 != 0)

So something simple as:
(simplify
 (cond @0 (plus @1 integer_all_onesp@2) @1)
 (minus @1 (convert @0)))


If you want to handle case where @2 is a power of 2 instead so you can use
shift, that is another option.

[Bug analyzer/101522] New: ICE: Segmentation fault (in ana::binding_cluster::purge_state_involving)

2021-07-19 Thread asolokha at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101522

Bug ID: 101522
   Summary: ICE: Segmentation fault (in
ana::binding_cluster::purge_state_involving)
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-12.0.0-alpha20210718 snapshot (g:6ae8aac19cdbdbd96d90f86e4d8505fe121bdf06)
intermittently ICEs when compiling the following testcase, reduced from
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/max.pass.cpp
from the libcxx 12.0.0 test suite, w/ -fanalyzer:

double
sqrt ();

namespace std {
  class gamma_distribution {
  public:
gamma_distribution () : _M_param () {}

  private:
struct param_type {
  param_type () : _M_beta () { _M_a2 = 1 / ::sqrt (); }
  double _M_beta, _M_a2;
};
param_type _M_param;
int _M_saved_available, _M_saved = 0, _M_param0 = 0;
  };

  struct fisher_f_distribution {
gamma_distribution _M_gd_x, _M_gd_y;
  };
}

int
main ()
{
  std::fisher_f_distribution d;

  return 0;
}

% MALLOC_PERTURB_=3 MALLOC_CHECK_=3 g++-12.0.0 -fanalyzer -c rxkecadv.cpp
during IPA pass: analyzer
rxkecadv.cpp: In constructor
'std::gamma_distribution::param_type::param_type()':
rxkecadv.cpp:11:55: internal compiler error: Segmentation fault
   11 |   param_type () : _M_beta () { _M_a2 = 1 / ::sqrt (); }
  |~~~^~
0x11077df crash_signal
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/toplev.c:328
0x150cefc ana::binding_cluster::purge_state_involving(ana::svalue const*,
ana::region_model_manager*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/store.cc:1330
0x150f75f ana::store::purge_state_involving(ana::svalue const*,
ana::region_model_manager*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/store.cc:2497
0x14e0a56 ana::region_model::purge_state_involving(ana::svalue const*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/region-model.cc:1309
0x14e0a56 ana::region_model::purge_state_involving(ana::svalue const*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/region-model.cc:1304
0x14e0c30 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*, bool*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/region-model.cc:1074
0x14e39c3 ana::region_model::on_stmt_pre(gimple const*, bool*, bool*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/region-model.cc:1027
0x14b42ed ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/engine.cc:1223
0x14b6882 ana::exploded_graph::process_node(ana::exploded_node*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/engine.cc:3098
0x14b73ea ana::exploded_graph::process_worklist()
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/engine.cc:2684
0x14b9845 ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/engine.cc:4972
0x14ba6e0 ana::run_checkers()
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/engine.cc:5043
0x14ab7a8 execute
   
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210718/work/gcc-12-20210718/gcc/analyzer/analyzer-pass.cc:87

This is a memory corruption failure, so only happens sporadically. Maybe I've
reduced the testcase too much, but I have to set glibc's MALLOC_PERTURB_=3
MALLOC_CHECK_=3 and also run compilation in a loop to reproduce it at least
several times in a run:

% for i in {1..100}; do MALLOC_PERTURB_=3 MALLOC_CHECK_=3 g++-12.0.0 -fanalyzer
-c rxkecadv.cpp; done

Valgrind gives the following when gcc ICEs:

% MALLOC_PERTURB_=3 MALLOC_CHECK_=3 g++-12.0.0 -fanalyzer -c rxkecadv.cpp
-wrapper valgrind,-q
==924238== Invalid read of size 8
==924238==at 0x150CF40: slide (hash-table.h:1115)
==924238==by 0x150CF40: operator++ (hash-table.h:1130)
==924238==by 0x150CF40: operator++ (hash-map.h:256)
==924238==by 0x150CF40:
ana::binding_cluster::purge_state_involving(ana::svalue const*,
ana::region_model_manager*) (store.cc:1326)
==924238==by 0x150F75F: ana::store::purge_state_involving(ana::svalue
const*, ana::region_model_manager*) (store.cc:2497)

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

Uroš Bizjak  changed:

   What|Removed |Added

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

--- Comment #36 from Uroš Bizjak  ---
Fixed by reverting PR71245.

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

--- Comment #35 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:5972907bd0528a04eb8fa4f9897714724da53f04

commit r9-9634-g5972907bd0528a04eb8fa4f9897714724da53f04
Author: Uros Bizjak 
Date:   Tue Jul 20 06:38:46 2021 +0200

i386: Remove atomic_storedi_fpu and atomic_loaddi_fpu peepholes [PR100182]

These patterns result in non-atomic sequence.

2021-07-21  Uroš Bizjak  

gcc/
PR target/100182
* config/i386/sync.md (define_peephole2 atomic_storedi_fpu):
Remove.
(define_peephole2 atomic_loaddi_fpu): Ditto.

gcc/testsuite/
PR target/100182
* gcc.target/i386/pr71245-1.c: Remove.
* gcc.target/i386/pr71245-2.c: Ditto.

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

--- Comment #34 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Uros Bizjak :

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

commit r10-9992-gff3a8cd277752fd6167c39c00391662e47f1d1c0
Author: Uros Bizjak 
Date:   Tue Jul 20 06:36:02 2021 +0200

i386: Remove atomic_storedi_fpu and atomic_loaddi_fpu peepholes [PR100182]

These patterns result in non-atomic sequence.

2021-07-21  Uroš Bizjak  

gcc/
PR target/100182
* config/i386/sync.md (define_peephole2 atomic_storedi_fpu):
Remove.
(define_peephole2 atomic_loaddi_fpu): Ditto.

gcc/testsuite/
PR target/100182
* gcc.target/i386/pr71245-1.c: Remove.
* gcc.target/i386/pr71245-2.c: Ditto.

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

--- Comment #33 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Uros Bizjak :

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

commit r11-8783-gf2060ae92f22e4877af21018cf3b8cc2eca4745e
Author: Uros Bizjak 
Date:   Tue Jul 20 06:29:39 2021 +0200

i386: Remove atomic_storedi_fpu and atomic_loaddi_fpu peepholes [PR100182]

These patterns result in non-atomic sequence.

2021-07-21  Uroš Bizjak  

gcc/
PR target/100182
* config/i386/sync.md (define_peephole2 atomic_storedi_fpu):
Remove.
(define_peephole2 atomic_loaddi_fpu): Ditto.

gcc/testsuite/
PR target/100182
* gcc.target/i386/pr71245-1.c: Remove.
* gcc.target/i386/pr71245-2.c: Ditto.

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

--- Comment #32 from CVS Commits  ---
The master branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:6d4da4aeef5b20f7f9693ddc27d26740d0dbe36c

commit r12-2407-g6d4da4aeef5b20f7f9693ddc27d26740d0dbe36c
Author: Uros Bizjak 
Date:   Tue Jul 20 06:15:16 2021 +0200

i386: Remove atomic_storedi_fpu and atomic_loaddi_fpu peepholes [PR100182]

These patterns result in non-atomic sequence.

2021-07-21  Uroš Bizjak  

gcc/
PR target/100182
* config/i386/sync.md (define_peephole2 atomic_storedi_fpu):
Remove.
(define_peephole2 atomic_loaddi_fpu): Ditto.

gcc/testsuite/
PR target/100182
* gcc.target/i386/pr71245-1.c: Remove.
* gcc.target/i386/pr71245-2.c: Ditto.

[Bug target/101472] AVX-512 wrong code for consecutive masked scatters

2021-07-19 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101472

Hongtao.liu  changed:

   What|Removed |Added

 CC||wwwhhhyyy333 at gmail dot com

--- Comment #1 from Hongtao.liu  ---
pattern is defined as 

(define_insn "*avx512f_scatterdi"
  [(set (match_operator:VI48F 5 "vsib_mem_operator"
  [(unspec:P
 [(match_operand:P 0 "vsib_address_operand" "Tv")
  (match_operand: 2 "register_operand" "v")
  (match_operand:SI 4 "const1248_operand" "n")]
 UNSPEC_VSIBADDR)])
(unspec:VI48F
  [(match_operand:QI 6 "register_operand" "1")
   (match_operand: 3 "register_operand" "v")]
  UNSPEC_SCATTER))
   (clobber (match_scratch:QI 1 "="))]
  "TARGET_AVX512F"
;; %X5 so that we don't emit any *WORD PTR for -masm=intel, as
;; gas changed what it requires incompatibly.
  "%M0vscatterq\t{%3, %5%{%1%}|%X5%{%1%}, %3}"
  [(set_attr "type" "ssemov")
   (set_attr "prefix" "evex")
   (set_attr "mode" "")])

mask register only affect set src, w/ same dest, gcc thinks the first set will
be overlapped, and optimizes the first vpscatterqpd away

we need to refine the pattern to let gcc know mask register also affect the
dest. maybe just put mask operation into UNSPEC_VSIBADDR?

[Bug tree-optimization/85636] Tree if-conversion inserts redundant loads

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85636

--- Comment #2 from Andrew Pinski  ---
I don't see this on the trunk:
  _1 = (long unsigned int) i_31;
  _2 = _1 * 4;
  _3 = c_11(D) + _2;
  v_12 = *_3;
  _6 = a_15(D) + _2;
  iftmp.1_8 = v_12 == 20 ? y_13(D) : x_14(D);
  _26 = v_12 != 20 ? y_13(D) : x_14(D);
  *_6 = _26;
  _5 = b_17(D) + _2;
  *_5 = iftmp.1_8;
  i_19 = i_31 + 1;
  ivtmp_28 = ivtmp_23 - 1;

[Bug tree-optimization/53947] [meta-bug] vectorizer missed-optimizations

2021-07-19 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
Bug 53947 depends on bug 100696, which changed state.

Bug 100696 Summary: mult_higpart is not vectorized
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100696

   What|Removed |Added

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

[Bug tree-optimization/100696] mult_higpart is not vectorized

2021-07-19 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100696

Kewen Lin  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |linkw at gcc dot gnu.org
 CC||linkw at gcc dot gnu.org

--- Comment #4 from Kewen Lin  ---
Should be fixed on trunk.

[Bug tree-optimization/100696] mult_higpart is not vectorized

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100696

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Kewen Lin :

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

commit r12-2404-ga1d27560770818c514ad1ad6683f89e1e1bcd0ec
Author: Kewen Lin 
Date:   Mon Jul 19 20:49:17 2021 -0500

vect: Recog mul_highpart pattern [PR100696]

This patch is to extend the existing pattern mulhs handlings
to cover normal multiply highpart pattern recognization, it
introduces one new internal function IFN_MULH for 1:1 map to
[su]mul_highpart optab.  Since it covers MULT_HIGHPART_EXPR
with optab support, i386 part change is to ensure it follows
the consistent costing path.

Bootstrapped & regtested on powerpc64le-linux-gnu P9,
x86_64-redhat-linux and aarch64-linux-gnu.

gcc/ChangeLog:

PR tree-optimization/100696
* internal-fn.c (first_commutative_argument): Add info for
IFN_MULH.
* internal-fn.def (IFN_MULH): New internal function.
* tree-vect-patterns.c (vect_recog_mulhs_pattern): Add support to
recog normal multiply highpart as IFN_MULH.
* config/i386/i386.c (ix86_add_stmt_cost): Adjust for combined
function CFN_MULH.

gcc/testsuite/ChangeLog:

PR tree-optimization/100696
* gcc.target/i386/pr100637-3w.c: Adjust for mul_highpart recog.

[Bug middle-end/54571] Missed optimization converting between bit sets

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54571

Andrew Pinski  changed:

   What|Removed |Added

 CC||dhowells at redhat dot com

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

[Bug tree-optimization/78317] "if (x & constant) z |= constant" should not be rendered with jumps and conditional moves

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78317

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #6 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> I think there is another bug about this already.

I was right I did see a bug about this :).

Anyways this is dup of bug 54571.

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

[Bug target/101471] AVX512 incorrect writemask generated for _mm512_fpclass_ps_mask in O0

2021-07-19 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101471

--- Comment #3 from Hongtao.liu  ---
We need to fixed for -O0 in header file.

[Bug target/101471] AVX512 incorrect writemask generated for _mm512_fpclass_ps_mask in O0

2021-07-19 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101471

Hongtao.liu  changed:

   What|Removed |Added

 CC||wwwhhhyyy333 at gmail dot com

--- Comment #2 from Hongtao.liu  ---
w/ -O0, it's defined as macro

#define _mm512_fpclass_ps_mask(x, c)\
  ((__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) (__m512) (x),\
 (int) (c),(__mmask8)-1))

and (__mmask16)-1 should be used

w/ -O2 it's ok

extern __inline __mmask16
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_fpclass_ps_mask (__m512 __A, const int __imm)
{
  return (__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) __A,
   __imm,
   (__mmask16) -1);
}

[Bug tree-optimization/81549] PHI node should be eliminated if loop iterates enough times.

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81549

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/80574] GCC fail to optimize nested ternary

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80574

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/80574] GCC fail to optimize nested ternary

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80574

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

--- Comment #7 from Andrew Pinski  ---
The original testcase in comment #0 is fixed in GCC 8, I don't know what caused
the improvement though.

[Bug tree-optimization/64700] Sink common code through PHI

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64700

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
 CC||pinskia at gcc dot gnu.org
   Severity|normal  |enhancement

--- Comment #4 from Andrew Pinski  ---
   [local count: 958878293]:
  if (dir_lsm.26_39 == 1)
goto ; [34.00%]
  else
goto ; [66.00%]

   [local count: 326018623]:
  _11 = arr1.6_10 + _5;
  _12 = *_11;
  goto ; [100.00%]

   [local count: 632859670]:
  _14 = arr2.9_13 + _5;
  _15 = *_14;

   [local count: 958878293]:
  # cstore_45 = PHI <_12(8), _15(9)>

PHI-OPT improvements that I am working on might be able to handle this case
too.
MEM_EXPR is a little harder than the normal expression as you need to check the
access type for aliasing reasons.

Note PHI-OPT does handle the casting case already (but it is not listed here).

[Bug tree-optimization/43423] gcc should vectorize this loop through if-conversion

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43423

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Severity|normal  |enhancement
 CC||pinskia at gcc dot gnu.org

--- Comment #13 from Andrew Pinski  ---
The improvement in comment #12 is something which I am working on.

[Bug tree-optimization/57702] Reassoc missed optimizations

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57702

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2013-06-25 00:00:00 |2021-7-19

--- Comment #4 from Andrew Pinski  ---
f2:
  _1 = y_3(D) * 3;
  _7 = _1 + x_2(D);
  _5 = y_3(D) + _7;

f4:
  _9 = y_3(D) * 19;
  _6 = x_4(D) + _9;

foo:
  _9 = y_2(D) * 5;
  x_7 = x_1(D) + _9;

[Bug tree-optimization/57567] Missed optimisation: compare + or

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57567

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Target Milestone|--- |7.0
   Severity|normal  |enhancement
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
Fixed for a while now.  Maybe before even GCC 7.

[Bug tree-optimization/38943] Optimization removes trapping instruction

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38943

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-20
 Ever confirmed|0   |1

[Bug rtl-optimization/95102] missed if-conversion

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95102

--- Comment #3 from Andrew Pinski  ---
(In reply to Richard Biener from comment #0)
> If you rewrite gcc.target/i386/pr54855-9.c to a form GIMPLE looks like after
> some PRE you end up with

I ran into this same thing when I was working on improving other areas too:
FAIL: gcc.target/i386/pr54855-8.c scan-assembler-not movsd
FAIL: gcc.target/i386/pr54855-8.c scan-assembler-times maxsd 1
FAIL: gcc.target/i386/pr54855-9.c scan-assembler-not movss
FAIL: gcc.target/i386/pr54855-9.c scan-assembler-times minss 1
:)

[Bug rtl-optimization/95102] missed if-conversion

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95102

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-20
   Severity|normal  |enhancement

--- Comment #2 from Andrew Pinski  ---
One thing that should be done:
  if (_1 < a_4(D))
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 536870913]:
  x_5 = BIT_INSERT_EXPR ;

   [local count: 1073741824]:
  # x_2 = PHI 


Be converted to:
  _1 = BIT_FIELD_REF ;
  nt_6 = BIT_FIELD_REF ;
  if (_1 < a_4(D))
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 536870913]:

   [local count: 1073741824]:
  # nt_7 = PHI 
  x_2 = BIT_INSERT_EXPR ;

And then normal phiopt would convert it to:
_1 = BIT_FIELD_REF ;
nt_7 = MIN <_1, a_4(D);
x_2 = BIT_INSERT_EXPR ;

But this would require a new part of tree-ssa-phiopt which does this, this
can't be done in match as far as I can tell; I don't know how profitable this
transfomration is either.

[Bug rtl-optimization/85390] possible missed optimisation / regression from 6.3 with conditional expression

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85390

--- Comment #2 from Andrew Pinski  ---
More likely we don't normally pull loads above conditionals at all especially
when there is one on each side.
Doing this:
extern int a, b, c;

int f(int x, int b, int a)
{
__builtin_prefetch((void *) (x ? a : b));
return c;
}
Shows that.

[Bug middle-end/85559] [meta-bug] Improve conditional move

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85559
Bug 85559 depends on bug 46279, which changed state.

Bug 46279 Summary: cmov not hoisted out of the loop
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46279

   What|Removed |Added

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

[Bug rtl-optimization/46279] cmov not hoisted out of the loop

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46279

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Depends on||89430
   Target Milestone|--- |8.0
 Status|NEW |RESOLVED

--- Comment #8 from Andrew Pinski  ---
Fixed for GCC 8, by one of the patches to tree-ssa-phiopt.c
(cond_store_replacement).


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
[Bug 89430] A missing ifcvt optimization to generate csel

[Bug tree-optimization/71336] Suboptimal code generated for "(a & 1) ? (CST1 + CST2) : CST1"

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71336

--- Comment #8 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #6)
> Sorry this one is more correct
> Something like (very much pesdu code):
> (simplify
>  (cond (eq (bit_and@0 @1 int_pow2p@2) integer_zerop) INTEGET_CST@3
> INTEGER_CST@4)
>  (switch
>   (if (@3 u> @4 && exact_pow2(@3 - @4))
>(convert (plus (mult (rshift @0:typeu @2) (minus @3:typeu @4:typeu))
> @4:typeu)))
>   (if (@4 u> @3 && exact_pow2(@4 - @3))
>(convert (minus (mult (rshift @0:typeu @2) (minus @4:typeu @3:typeu))
> @3:typeu))
>  ))
> 
> The mult could be changed to lshift to be more correct.

I should note, the above is now only possible because of the recent changes I
did to phi-opt.  You no longer need to open code anything in phi-opt for things
like this bug, just add them to match.pd and be done with it :).

[Bug tree-optimization/71336] Suboptimal code generated for "(a & 1) ? (CST1 + CST2) : CST1"

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71336

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/71336] Suboptimal x86 code generated for "(a & 1) ? (CST1 + CST2) : CST1"

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71336

Andrew Pinski  changed:

   What|Removed |Added

  Component|rtl-optimization|tree-optimization

--- Comment #7 from Andrew Pinski  ---
(In reply to Jakub Jelinek from comment #3)
> I guess it could be useful even without lea.

Pretty much.
Even on aarch64 we get for the original case:
ubfiz   w0, w0, 2, 1
add w0, w0, 3
ret
vs
tst x0, 1
mov w2, 7
mov w1, 3
cselw0, w2, w1, ne
ret

For something slightly different:
unsigned test(unsigned a) {
return a & 4 ? 7 : 3;
}

unsigned test1(unsigned a)
{
  a &= 4;
  a >>= 2;
  return a*4 + 3;
}


We get:
tst x0, 4
mov w2, 7
mov w1, 3
cselw0, w2, w1, ne
ret
vs
and w0, w0, 4
add w0, w0, 3
ret

[Bug rtl-optimization/71336] Suboptimal x86 code generated for "(a & 1) ? (CST1 + CST2) : CST1"

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71336

--- Comment #6 from Andrew Pinski  ---
Sorry this one is more correct
Something like (very much pesdu code):
(simplify
 (cond (eq (bit_and@0 @1 int_pow2p@2) integer_zerop) INTEGET_CST@3
INTEGER_CST@4)
 (switch
  (if (@3 u> @4 && exact_pow2(@3 - @4))
   (convert (plus (mult (rshift @0:typeu @2) (minus @3:typeu @4:typeu))
@4:typeu)))
  (if (@4 u> @3 && exact_pow2(@4 - @3))
   (convert (minus (mult (rshift @0:typeu @2) (minus @4:typeu @3:typeu))
@3:typeu))
 ))

The mult could be changed to lshift to be more correct.

[Bug rtl-optimization/71336] Suboptimal x86 code generated for "(a & 1) ? (CST1 + CST2) : CST1"

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71336

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2016-05-30 00:00:00 |2021-7-19

--- Comment #5 from Andrew Pinski  ---
Something like (very much pesdu code):
(simplify
 (cond (eq (bit_and@0 @1 int_pow2p@2) integer_zerop) INTEGET_CST@3
INTEGER_CST@4)
 (switch
  (if (@3 u> @4 && exact_pow2(@3 - @4))
   (convert (plus (mult @0:typeu (minus @3:typeu @4:typeu)) @4:typeu)))
  (if (@4 u> @3 && exact_pow2(@4 - @3))
   (convert (minus (mult @0:typeu (minus @4:typeu @3:typeu)) @3:typeu))
 ))

[Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40987

--- Comment #12 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #11)
> This bug is now hard to hit on the trunk as i?86 requires host wide word as
> 64bit.

HWINT is now required to be 64bit for all targets even.
So this might happen if there is some TImode but then the patch might be best
thing really.

[Bug rtl-optimization/14418] Unnecessary loads and stores for tail call

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14418

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2006-10-22 21:08:49 |2021-7-19

--- Comment #4 from Andrew Pinski  ---
-m32:
pushl   %esi
pushl   %ebx
subl$16, %esp
movl28(%esp), %ebx
movl32(%esp), %esi
leal(%ebx,%ebx), %eax
pushl   %eax
callbar
movl%esi, 36(%esp)
movl%ebx, 32(%esp)
addl$20, %esp
popl%ebx
popl%esi
jmp quux

-m32 -march=i686:
subl$28, %esp
movl%ebx, 20(%esp)
movl32(%esp), %ebx
movl%esi, 24(%esp)
movl36(%esp), %esi
leal(%ebx,%ebx), %eax
movl%eax, (%esp)
callbar
movl%esi, 36(%esp)
movl24(%esp), %esi
movl%ebx, 32(%esp)
movl20(%esp), %ebx
addl$28, %esp
jmp quux

So in the non-i686 case, it is doing push/pop's do the same as the mov's.

[Bug c/100501] ICE: segmentation fault on embedded asm code

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100501

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-07-19

--- Comment #4 from Andrew Pinski  ---
C++ front-end rejects this:
t67.c:1:13: error: memory input 0 is not directly addressable
1 | int foo() { __asm__("" : : "m"(({}))); }
  | ^~~

[Bug c/100360] scalar operation fails the compilation

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100360

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|WAITING |RESOLVED

--- Comment #5 from Andrew Pinski  ---
Works when using the same GMP as being compiled with so closing as invalid.

[Bug inline-asm/99998] Unnecessary jump instruction

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
  Component|c   |inline-asm
 Status|NEW |RESOLVED

--- Comment #2 from Andrew Pinski  ---
GCC does not look into the inline-asm to see if it is empty or not.  Since the
inline-asm is marked as volatile, it cannot be made as unconditional either.
So closing as won't fix.

[Bug preprocessor/88544] ICE on ARM Cortex A7

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88544

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|WAITING |RESOLVED
  Component|c   |preprocessor

--- Comment #5 from Andrew Pinski  ---
No feedback in over 2 years so closing as invalid.

[Bug c/81779] [7 Regression] bool define from stdbool.h suppresses -Wdeclaration-after-statement

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81779

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|6.4 |8.0

--- Comment #4 from Andrew Pinski  ---
Fixed in GCC 8 so closing as such.

[Bug middle-end/77779] unnecessary trap checks for pointer subtraction with -ftrapv

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9

--- Comment #2 from Andrew Pinski  ---
This might be fixed now but I could be wrong.

[Bug middle-end/66630] Missing ubsan/ftrapv error

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

Andrew Pinski  changed:

   What|Removed |Added

 CC||vincent-gcc at vinc17 dot net

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

[Bug middle-end/87311] missing integer overflow detection on negation of the minimum value with -ftrapv or UB sanitizer

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87311

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
This is an exact dup of bug 66630.

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

[Bug middle-end/101521] New: -ftrapv should become something like -fsanitize=undefined -fsanitize-undefined-trap-on-error

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101521

Bug ID: 101521
   Summary: -ftrapv should become something like
-fsanitize=undefined
-fsanitize-undefined-trap-on-error
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

As mentioned a few times -ftrapv is broken in many cases it would be better if
it become something like -fsanitize=undefined
-fsanitize-undefined-trap-on-error.

[Bug testsuite/101520] [12 regression] gcc.target/powerpc/pr93658.c has excess errors after r12-2338

2021-07-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101520

Martin Sebor  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org

--- Comment #2 from Martin Sebor  ---
I have suppressed the warnings in r12-2401.

[Bug libstdc++/101510] std::filesystem::create_directory on an existing symlink to a directory

2021-07-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101510

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
   Last reconfirmed||2021-07-19
 Ever confirmed|0   |1

[Bug middle-end/61577] [4.9.0 Regression] can't compile on hp-ux v3 ia64

2021-07-19 Thread me at larbob dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61577

--- Comment #255 from Larkin Nickle  ---
Here's the log from the attempted 11.1 build against binutils 2.30. Built with
4.8.5. I'm not able to attach this as it's over the max size limit.

https://gist.githubusercontent.com/larb0b/f3a855892f7b16f4676444f2c056947e/raw/e94e0a3b54a555e6111ecef634d082d78d983ee9/gcc-11.1.0.b

[Bug middle-end/80410] Improve merging of identical branches

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80410

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
  Component|c   |middle-end
   Severity|normal  |enhancement

[Bug c/48274] C frontend emit invalid promotions (TARGET_PROMOTE_PROTOTYPES )

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48274

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2011-03-24 14:58:31 |2021-7-19
   Keywords||missed-optimization
Summary|C frontend emit invalid |C frontend emit invalid
   |promotions  |promotions
   ||(TARGET_PROMOTE_PROTOTYPES
   ||)

--- Comment #5 from Andrew Pinski  ---
Still true today.

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

--- Comment #31 from Uroš Bizjak  ---
(In reply to H.J. Lu from comment #30)
> (In reply to Uroš Bizjak from comment #29)
> > (In reply to H.J. Lu from comment #28)
> > > 29_atomics/atomic_ref/wait_notify.c has the same issue on Linux/x86-64 
> > > with
> > > -m32:
> > 
> > Are you sure? The mentioned peephole2 patterns now emit only x87 or SSE
> > DFmode loads/stores that are guaranteed to be atomic.
> 
> It does happen, but not very often.

OK, I will simply remove *all* these peephole2s.

[Bug testsuite/101520] [12 regression] gcc.target/powerpc/pr93658.c has excess errors after r12-2338

2021-07-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101520

Martin Sebor  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-19
  Component|other   |testsuite
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
The test uses a loop to write into consecutive bytes of a char variable.  The
loop vectorizer turns it into a series of assignments of vector(16) char each,
which the warning then points out.  A simple fix for the test is
straightforward: suppress the warning.

A better solution to this class of problems is to constrain the loop unroller
and/or vectorizer to prevent emitting more stores than fit in the destination.

[Bug target/100182] [8/9/10/11/12 Regression] Miscompilation of atomic_float/1.cc and atomic_float/wait_notify.cc on i686

2021-07-19 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100182

--- Comment #30 from H.J. Lu  ---
(In reply to Uroš Bizjak from comment #29)
> (In reply to H.J. Lu from comment #28)
> > 29_atomics/atomic_ref/wait_notify.c has the same issue on Linux/x86-64 with
> > -m32:
> 
> Are you sure? The mentioned peephole2 patterns now emit only x87 or SSE
> DFmode loads/stores that are guaranteed to be atomic.

It does happen, but not very often.

[Bug c++/101219] [12 Regression] ice in perform_or_defer_access_check since r12-1804-g65870e75616ee435

2021-07-19 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101219

--- Comment #5 from Sergei Trofimovich  ---
build_ptrmemfunc_type() creates fresh RECORD_TYPE for (each?) __pfn. Should it
probably populate TYPE_BINFO(t) as well?
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/cp/decl.c;h=01d64a16125ec0bb8e3798136472c30f475f96a2;hb=HEAD#l10526

[Bug c++/101219] [12 Regression] ice in perform_or_defer_access_check since r12-1804-g65870e75616ee435

2021-07-19 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101219

--- Comment #4 from Sergei Trofimovich  ---
Got the same mednafen crash today. Poked slightly at the context in gdb.

>From what I understand the crash happens when analysing statement `void
(PCEFast_PSG::*ch_0)(int, int *);`. There is no access to the any object field
implied by `TYPE_BINFO (access_type)`. Or is there? Should it refer to `class
PCEFast_PSG`?

(gdb) fr 1
#1  0x0079ff83 in finish_non_static_data_member (decl=0x77652a18,
object=0x77796860, qualifying_scope=0x0) at
/home/slyfox/dev/git/gcc/gcc/cp/semantics.c:2208
2208  perform_or_defer_access_check (TYPE_BINFO (access_type), decl,

(gdb) list
2203 QUALIFYING_SCOPE is also non-null.  */
2204  else
2205{
2206  volatile tree access_type = TREE_TYPE (object);
2207
2208  perform_or_defer_access_check (TYPE_BINFO (access_type), decl,
2209 decl, tf_warning_or_error);
2210
2211  /* If the data member was named `C::M', convert `*this' to `C'
2212 first.  */

(gdb) call print_tree(object)
No symbol "print_tree" in current context.
(gdb) call debug_tree(object)
 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x777a1bd0
fields 
unsigned nonaddressable DI psg.cpp.cpp:5:39
size 
unit-size 
align:64 warn_if_not_align:0 offset_align 128
offset 
bit-offset  context
 chain >
ptrmemfunc fn type 
public unsigned type_6 DI size 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x777a1b28>
chain >
constant>

(gdb) call debug_tree(access_type)
  constant 128>
unit-size  constant 16>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x777a1bd0
fields 
public unsigned type_6 DI
size 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x777a1b28>
unsigned nonaddressable DI psg.cpp.cpp:5:39 size  unit-size 
align:64 warn_if_not_align:0 offset_align 128
offset 
bit-offset  context 
chain 
nonaddressable DI psg.cpp.cpp:5:39 size  unit-size 
align:64 warn_if_not_align:0 offset_align 128 offset  bit-offset  context
>> ptrmemfunc fn type 
chain >

[Bug other/101520] New: [12 regression] gcc.target/powerpc/pr93658.c has excess errors after r12-2338

2021-07-19 Thread seurer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101520

Bug ID: 101520
   Summary: [12 regression] gcc.target/powerpc/pr93658.c has
excess errors after r12-2338
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:f0500db3692276f60e0562c17c87a0cb03e34398, r12-2338
make  -k check-gcc RUNTESTFLAGS="powerpc.exp=gcc.target/powerpc/pr93658.c"
FAIL: gcc.target/powerpc/pr93658.c (test for excess errors)
# of unexpected failures1


I am not sure if these are real issues in the test case or not.


Executing on host: /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/ exceptions_enabled4114679.cc   
-fdiagnostics-plain-output  -S -o exceptions_enabled4114679.s(timeout = 5)
spawn -ignore SIGHUP /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/ exceptions_enabled4114679.cc
-fdiagnostics-plain-output -S -o exceptions_enabled4114679.s
FAIL: gcc.target/powerpc/pr93658.c (test for excess errors)
Excess errors:
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 1 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.target/powerpc/pr93658.c:18:10:

[Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839

2021-07-19 Thread wschmidt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101129

Bill Schmidt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
  Known to fail|11.1.1  |

--- Comment #14 from Bill Schmidt  ---
Now fixed everywhere.

[Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101129

--- Comment #13 from CVS Commits  ---
The releases/gcc-9 branch has been updated by William Schmidt
:

https://gcc.gnu.org/g:3e4b43ec9a937866ead88e996bd200b116a1766c

commit r9-9632-g3e4b43ec9a937866ead88e996bd200b116a1766c
Author: Bill Schmidt 
Date:   Mon Jul 19 16:14:36 2021 -0500

rs6000: Don't let swaps pass break multiply low-part (PR101129)

Backport from mainline.

2021-07-15  Bill Schmidt  

gcc/
PR target/101129
* config/rs6000/rs6000-p8swap.c (has_part_mult): New.
(rs6000_analyze_swaps): Insns containing a subreg of a mult are
not swappable.

gcc/testsuite/
PR target/101129
* gcc.target/powerpc/pr101129.c: New.

[Bug middle-end/61577] [4.9.0 Regression] can't compile on hp-ux v3 ia64

2021-07-19 Thread me at larbob dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61577

--- Comment #254 from Larkin Nickle  ---
I've now tried 11.1.0 almost exactly as The Written Word builds it, and still
get:

during GIMPLE pass: dce
../../libiberty/mkstemps.c: In function 'mkstemps':
../../libiberty/mkstemps.c:80:1: internal compiler error: Illegal instruction
   80 | mkstemps (char *pattern, int suffix_len)
  | ^~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

This happens against binutils 2.30 as TWW builds it, and against 2.36 or 2.37.
I also have to enable a version of gcc-11.1.0-PR64919.patch with #undef
MAKE_DECL_ONE_ONLY removed in order to build libgcov at a lower optimization
level to even get to this point. TWW gets this issue with 10.3, but not 11.1
for some reason.

[Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879

2021-07-19 Thread amacleod at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101511

Andrew Macleod  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org

--- Comment #3 from Andrew Macleod  ---
The new relation code is dominance based,  in the interest of efficiency, it
can currently miss the odd equivalence if things are processed in a
non-dominance order.

Its not incorrect, it just may lead to a missed opportunity.

This testcase triggers an assert which checks for this situation.  There are
numerous UNDEFINED values, and we end up register an equivalences:

 Registering value_relation (Error_18 == _4) (bb4) at Error_18 = _4 + Error_13;
 Registering value_relation (Error_13 == _4) (bb2) at Error_13 = _4 + Error_9;

Not we register the bb4 equivalence first,  and then alter register the one in
bb2.

As a result, we don't currently update post dominated blocks, so we dont
combine these into Error_18, Error_13 and _4 in bb4.
When we later check for an equivalence between we detect this anomaly.
There is nothing incorrect in allowing it, and we'll do so for now.  
Eventually, when its flushed out better, we'll change this back to an assert.

[Bug sanitizer/101111] xgcc cross-compiler for x86_64-apple-darwin in GCC 11.1 doesn't generate weak symbols, resulting in undefined reference to ___lsan_default_suppressions

2021-07-19 Thread mose at gnu dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10

--- Comment #7 from Mosè Giordano  ---
Bump.  Is there any chance someone can review a one-line patch? :)

[Bug c++/95520] [coroutines] __builtin_FUNCTION() returns mangled .actor instead of original function name

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95520

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

https://gcc.gnu.org/g:237ab3ee49e2f3110accfcc03b6c0df8b4889f15

commit r12-2400-g237ab3ee49e2f3110accfcc03b6c0df8b4889f15
Author: Iain Sandoe 
Date:   Thu Jul 8 09:42:49 2021 +0100

coroutines: Adjust outlined function names [PR95520].

The mechanism used to date for uniquing the coroutine helper
functions (actor, destroy) was over-complicating things and
leading to the noted PR and also difficulties in setting
breakpoints on these functions (so this will help PR99215 as
well).

This implementation delegates the adjustment to the mangling
to write_encoding() which necessitates some book-keeping so
that it is possible to determine which of the coroutine
helper names is to be mangled.

Signed-off-by: Iain Sandoe 

PR c++/95520 - [coroutines] __builtin_FUNCTION() returns mangled .actor
instead of original function name

PR c++/95520

gcc/cp/ChangeLog:

* coroutines.cc (struct coroutine_info): Add fields for
actor and destroy function decls.
(to_ramp): New.
(coro_get_ramp_function): New.
(coro_get_actor_function): New.
(coro_get_destroy_function): New.
(act_des_fn): Set up mapping between ramp, actor and
destroy functions.
(morph_fn_to_coro): Adjust interface to the builder for
helper function decls.
* cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
JOIN_STR): New.
* mangle.c (write_encoding): Handle coroutine helpers.
(write_unqualified_name): Handle lambda coroutine helpers.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr95520.C: New test.

[Bug fortran/101513] ICE in gfc_alloc_allocatable_for_assignment, at fortran/trans-array.c:10313

2021-07-19 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101513

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Last reconfirmed||2021-07-19
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

Workaround: do not use parentheses on the rhs.

[Bug c++/101519] Improve diagnostic for template name used as base class

2021-07-19 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101519

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-07-19
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug c++/101519] New: Improve diagnostic for template name used as base class

2021-07-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101519

Bug ID: 101519
   Summary: Improve diagnostic for template name used as base
class
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

template struct A { };
template struct B : A { };

a.C:2:35: error: expected class-name before ‘{’ token
2 | template struct B : A { };
  |   ^

While the error is technically correct, it would be more helpful to point out
that a template argument list is expected.


Clang does not better than GCC:

a.C:2:33: error: expected class name
template struct B : A { };
^
1 error generated.

But EDG does well:

"a.C", line 2: error: argument list for class template "A" is missing
  template struct B : A { };
  ^

"a.C", line 2: error: not a class or struct name
  template struct B : A { };
  ^

2 errors detected in the compilation of "a.C".


I think the current error would be fine if it was followed by a note:

note: 'A' is a class template; add a template argument list to use it as a
base-class

[Bug analyzer/101503] [12 Regression] ICE in involves_p, at analyzer/svalue.cc:557

2021-07-19 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101503

David Malcolm  changed:

   What|Removed |Added

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

--- Comment #3 from David Malcolm  ---
Should be fixed by the above patch.

[Bug analyzer/101503] [12 Regression] ICE in involves_p, at analyzer/svalue.cc:557

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101503

--- Comment #2 from CVS Commits  ---
The master branch has been updated by David Malcolm :

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

commit r12-2399-ga113b14398f2a4ad2742e6e9c87e25cac60f263e
Author: David Malcolm 
Date:   Mon Jul 19 15:44:02 2021 -0400

analyzer: add svalue::can_have_associated_state_p [PR101503]

PR analyzer/101503 reports an assertion failure due to an unexpected
"UNKNOWN" value (due to using --param analyzer-max-svalue-depth=0).

This patch fixes this by rejecting attempts to purge state involving
unknown/poisoned svalues (in region_model::purge_state_involving),
as these svalues should not have state associated with them - they
are singletons w.r.t each type.

To be more systematic about this, the patch also introduces a new
svalue::can_have_associated_state_p which returns false for
unknown/poisoned svalues, so that we can reject adding constraints
or sm-state on them, or building various kinds of svalue in terms
of them (e.g. unary ops, binary ops, etc).

gcc/analyzer/ChangeLog:
PR analyzer/101503
* constraint-manager.cc (constraint_manager::add_constraint): Use
can_have_associated_state_p rather than testing for unknown.
(constraint_manager::get_or_add_equiv_class): Likewise.
* program-state.cc (sm_state_map::set_state): Likewise.
(sm_state_map::impl_set_state): Add assertion.
* region-model-manager.cc
(region_model_manager::maybe_fold_unaryop): Handle poisoned
values.
(region_model_manager::maybe_fold_binop): Move handling of unknown
values...
(region_model_manager::get_or_create_binop): ...to here, and
generalize to use can_have_associated_state_p.
(region_model_manager::maybe_fold_sub_svalue): Use
can_have_associated_state_p rather than testing for unknown.
(region_model_manager::maybe_fold_repeated_svalue): Use unknown
when the size or repeated value is "unknown"/"poisoned".
* region-model.cc (region_model::purge_state_involving): Reject
attempts to purge unknown/poisoned svalues, as these svalues
should not have state associated with them.
* svalue.cc (sub_svalue::sub_svalue): Assert that we're building
on top of an svalue with can_have_associated_state_p.
(repeated_svalue::repeated_svalue): Likewise.
(bits_within_svalue::bits_within_svalue): Likewise.
* svalue.h (svalue::can_have_associated_state_p): New.
(unknown_svalue::can_have_associated_state_p): New.
(poisoned_svalue::can_have_associated_state_p): New.
(unaryop_svalue::unaryop_svalue): Assert that we're building on
top of an svalue with can_have_associated_state_p.
(binop_svalue::binop_svalue): Likewise.
(widening_svalue::widening_svalue): Likewise.

gcc/testsuite/ChangeLog:
PR analyzer/101503
* gcc.dg/analyzer/pr101503.c: New test.

Signed-off-by: David Malcolm 

[Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101129

--- Comment #12 from CVS Commits  ---
The releases/gcc-10 branch has been updated by William Schmidt
:

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

commit r10-9990-gecad28561c47f5b2652a03e9b67cf37c13d88f53
Author: Bill Schmidt 
Date:   Mon Jul 19 14:38:23 2021 -0500

rs6000: Don't let swaps pass break multiply low-part (PR101129)

Backport from mainline.

2021-07-15  Bill Schmidt  

gcc/
PR target/101129
* config/rs6000/rs6000-p8swap.c (has_part_mult): New.
(rs6000_analyze_swaps): Insns containing a subreg of a mult are
not swappable.

gcc/testsuite/
PR target/101129
* gcc.target/powerpc/pr101129.c: New.

[Bug testsuite/31290] gcc.c-torture/execute/920612-1.c and gcc.c-torture/execute/920711-1.c depend on signed overflow being defined

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31290

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
gcc.c-torture/execute/920612-1.c was fixed with r0-109082.
gcc.c-torture/execute/920711-1.c was fixed with r0-109083.

So closing as fixed.

[Bug debug/101473] debug_line info depends on toolchain path

2021-07-19 Thread tonyb at cybernetics dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101473

--- Comment #12 from tonyb at cybernetics dot com ---
The patch fixed my own programs, so I rebuilt all of Yocto with -flto in two
different directories.  I found that most shared libraries in /lib and /usr/lib
still have the problem (i.e. are still not binary reproducible), as well as
binaries from pciutils, e2fsprogs, dropbear, sysvinit, hdparm, and a few other
packages (they are all binary reproducible without -flto).  However, the patch
certainly did improve things, since some binaries that were different
previously are now the same.

[Bug tree-optimization/101518] Invalid value in bit-field when setting underlying data through reference

2021-07-19 Thread klimkin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101518

--- Comment #2 from Alexey Klimkin  ---
Thank you for your prompt reply!

[Bug tree-optimization/101518] Invalid value in bit-field when setting underlying data through reference

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101518

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andrew Pinski  ---
You are violating strict aliasing rules.
You can work around this either by the following:
may_alias attribute
memcpy (only portable option)
-fno-strict-aliasing
Unions

[Bug tree-optimization/57668] Regression in vectorizing memcpy pattern.

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57668

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2013-06-24 00:00:00 |2021-7-19
 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|--- |8.3

--- Comment #3 from Andrew Pinski  ---
Fixed in 8.3 at least for skylake-512 (Intel(R) Xeon(R) D-2166NT CPU @
2.00GHz):
memcpyO3-831.s
0.68
memcpyO3-4.7.s
0.62
memcpyO3-4.9.s
0.78
memcpyO3-11.s
0.63

[Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221

2021-07-19 Thread amacleod at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101497

--- Comment #5 from Andrew Macleod  ---
  uc_1.0_1 = uc_1;
  _2 = (int) uc_1.0_1;
  _3 = 211 - _2;

_3 evaluates as 211 - [-128, 127], or [84, 339]

  _4 = _3 > 0;
  _5 = (int) _4;
  func_12_uli_6 = _5;
  i_4.1_6 = i_4;
  _7 = i_4.1_6 % 0;

We changed it so that anything mod 0 was undefined.  so _7 is UNDEFINED.
  i_4 = _7;
  _11 = _3 > 0;

_3 i s[84, 339] meaning _11 always evaluates TRUE.

  _10 = _11 ? _7 : 0;

The code for COND_EXPR confirms the types match when it folds. In this case,
the result is UNDEFINED.. undefined has no type, so we need to add a check for
that.

[Bug tree-optimization/101518] New: Invalid value in bit-field when setting underlying data through reference

2021-07-19 Thread klimkin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101518

Bug ID: 101518
   Summary: Invalid value in bit-field when setting underlying
data through reference
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: klimkin at gmail dot com
  Target Milestone: ---

In the example below, GCC starting v10 seems to produce invalid code for
accessing a bit field when the value for the underlying memory is set through a
reference. Consider example:

struct BitFieldLayout {
using DataType = unsigned;

BitFieldLayout() { reinterpret_cast(*this) = {}; }

DataType& raw_ref() { return reinterpret_cast(*this); }

DataType a : 1;
};

class Ref {
public:
operator unsigned&() { return value; }
unsigned& value;
};

int f()
{
BitFieldLayout bfl;
Ref ref{bfl.raw_ref()};
ref.value = 1;
return bfl.a; // expected value is 1
}


g++ (Compiler-Explorer-Build) 11.1.0
f():
xor eax, eax
ret
g++ (Compiler-Explorer-Build-gcc--binutils-2.36.1) 9.4.0
f():
mov eax, 1
ret
clang version 12.0.1
f():  # @f()
mov eax, 1
ret

[Bug testsuite/101517] Some testcases were lost when tree-ssa was merged

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101517

--- Comment #1 from Andrew Pinski  ---
I should note the tree-ssa merge is r0-58166 .

[Bug testsuite/101517] New: Some testcases were lost when tree-ssa was merged

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101517

Bug ID: 101517
   Summary: Some testcases were lost when tree-ssa was merged
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

I was looking at PR 16016 and noticed it references gcc.dg/20030612-1.c
testcase but when I look at the history there, the testcase is way different
from what it was pre tree-ssa merge.

Here are testcases which seems to have been changed incorrectly:
g++.dg/warn/Wunused-5.C
gcc.c-torture/compile/20030405-1.c
gcc.c-torture/compile/20040304-1.c
gcc.dg/20030612-1.c

[Bug c++/100828] Arbitrary limit on constraint complexity

2021-07-19 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100828

Patrick Palka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
 CC||ppalka at gcc dot gnu.org
 Ever confirmed|0   |1
   Last reconfirmed||2021-07-19
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
   Target Milestone|--- |11.2

--- Comment #1 from Patrick Palka  ---
Confirmed.  This complexity limit is probably there because the subsumption
algorithm (namely the conversion to DNF/CNF) can use an exponential amount of
space, but I think we can improve this and avoid the exponential memory usage
in the first place.  Then we could safely remove the complexity limit.

[Bug target/52258] __builtin_isgreaterequal is sometimes signaling on ARM

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52258

--- Comment #5 from Andrew Pinski  ---
I think this was fixed in GCC 10 with r10-6245 and maybe a few others.

[Bug tree-optimization/101496] [12 Regression] ice during GIMPLE pass: evrp

2021-07-19 Thread amacleod at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101496

Andrew Macleod  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-19
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

--- Comment #6 from Andrew Macleod  ---
This test case has unreachable code in it. 
This issue comes down to

  func_14_s_5.0_1 = func_14_s_5;
  _2 = func_14_s_5.0_1 < 0;
  c_1.2_4 = c_1;
  _5 = func_14_s_5.0_1 != c_1.2_4;
  _6 = _2 | _5;
  _7 = (int) _6;
  us_3.3_8 = us_3;
  _9 = _7 | us_3.3_8;
  us_3 = _9;
  us_3.6_11 = (unsigned int) _9;
  if (us_3.6_11 == 0)
goto ; [INV]
  else
goto ; [INV]

We determine that in order for us_3.6_11 to be == 0 and take the branch to bb4,
that _9, _7, _2 and _5 must all also be 0.   This means that
_5 = func_14_s_5.0_1 != c_1.2_4;
must be false, which then means that
  func_14_s_5.0_1 == c_1.2_4

_2 being false also means func_14_s_5.0_1 >= 0 or  [0, +INF]

Next:
   :
  _16 = c_1.2_4 >= _9;
  _17 = (unsigned int) _16;
  if (_17 != 0)
goto ; [INV]
  else
goto ; [INV]

to take the branch to bb5, c_1.2_4 must be < _9, (_9 is known to be [0,0]..
meaning its range would be [-INF, -1].

we arent fully exploiting equivalences yet, so we dont fold this branch, even
though we potentially could.  With  func_14_s_5.0_1 == c_1.2_4, that means
c_1.2_4 will enter this branch with the range [0, +INF] which means it can
never be < _9 and we will always branch to BB 9.   We currently miss that fold,
so don't realize yet that bb_5 in unreachable.

but this leads us to the next branch, which is causing the problem:
   :
  if (func_14_s_5.0_1 <= c_1.2_4)
goto ; [INV]
  else
goto ; [INV]

Ranger first tries to fold with relations, so it determines that this is always
TRUE since func_14_s_5.0_1 == c_1.2_4.  The simplification code still has
legacy support in it, and confirms that whatever we come up with the with new
range API matches the old code.  The old code says   
 func_14_s_5.0_1 == [0, +INF],  and c_1.2_4 == [-INF, -1], so this branch is
never taken.. result is FALSE.
Now an assert it tripped saying the 2 approaches do not agree on which edge
would be taken. The code is unreachable.. so it doesnt really matter.

To fix this, I am tweaking the simplification code for now to simply use the
value the new API returns, if it returns one.
Otherwise, it then checks the old API and the only time it is allowed to find a
taken edge is if the NEW API says the fold is undefined. 

Eventually we can remove that too, but for now, I leave it as a sanity check to
ensure we dont find something important, and it is harmless for the OLD API
code to remove unreachable code.


This function eventually folds to
   [local count: 10631108]:

   [local count: 1073741824]:
  goto ;

[Bug target/39677] AMD Opteron E needs workaround for lock erratum

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39677

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #5 from Andrew Pinski  ---
So reading https://www.amd.com/system/files/TechDocs/25759.pdf and errata #147,
the errata only occurs if lock is not there:
The erratum will not occur if there is a LOCK prefix on the read-modify-write
instruction. 

And GCC never emits a cmpxchg without a lock prefix so there is nothing to be
done.

[Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101129

--- Comment #11 from CVS Commits  ---
The releases/gcc-11 branch has been updated by William Schmidt
:

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

commit r11-8780-gac0efe3c6fc6231b20ffd684956a4a5c3c54a96b
Author: Bill Schmidt 
Date:   Mon Jul 19 12:49:17 2021 -0500

rs6000: Don't let swaps pass break multiply low-part (PR101129)

Backport from mainline.

2021-07-15  Bill Schmidt  

gcc/
PR target/101129
* config/rs6000/rs6000-p8swap.c (has_part_mult): New.
(rs6000_analyze_swaps): Insns containing a subreg of a mult are
not swappable.

gcc/testsuite/
PR target/101129
* gcc.target/powerpc/pr101129.c: New.

[Bug target/3985] AIX -mcpu=630 -maix64 does not use ppc64 multilib

2021-07-19 Thread dje at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3985

David Edelsohn  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |WONTFIX

--- Comment #10 from David Edelsohn  ---
PPC630 and AIX 4.3 is too old. This now functions correctly for newer processor
specs.

[Bug tree-optimization/101515] [11/12 Regression] ICE in pp_cxx_unqualified_id, at cp/cxx-pretty-print.c:128

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101515

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||diagnostic
  Component|c++ |tree-optimization
   Target Milestone|--- |11.2

--- Comment #1 from Andrew Pinski  ---
This is crashing while printing the warning.

[Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075

2021-07-19 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101516

Bug ID: 101516
   Summary: [10/11/12 Regression] ICE in
finish_omp_reduction_clause, at cp/semantics.c:6075
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r10 between 20191006 and 20191013 :


$ cat z1.cc
template  void foo (T, T[], T *, int, int (& v)[], int *)
{
  #pragma omp parallel reduction (+:v) allocate(v)
  ;
}
void test ()
  {
  long x;
  long y[] {};
  long * z;
  int u;
  int v[4];
  int * w;
  foo (x, y, z, u, v, w);
}


$ g++-12-20210718 -c z1.cc -fopenmp
z1.cc: In instantiation of 'void foo(T, T*, T*, int, int (&)[], int*) [with T =
long int]':
z1.cc:14:7:   required from here
z1.cc:3:11: internal compiler error: Segmentation fault
3 |   #pragma omp parallel reduction (+:v) allocate(v)
  |   ^~~
0xd6d5af crash_signal
../../gcc/toplev.c:328
0xa9bbdf size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../gcc/fold-const.c:1897
0x87082d finish_omp_reduction_clause
../../gcc/cp/semantics.c:6075
0x87082d finish_omp_clauses(tree_node*, c_omp_region_type)
../../gcc/cp/semantics.c:8597
0x846fe0 tsubst_omp_clauses
../../gcc/cp/pt.c:17555
0x841f9a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18669
0x841f47 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18479
0x8367d1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:25869
0x8367d1 instantiate_body
../../gcc/cp/pt.c:25869
0x837789 instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.c:26162
0x85152b instantiate_pending_templates(int)
../../gcc/cp/pt.c:26241
0x765822 c_parse_final_cleanups()
../../gcc/cp/decl2.c:4991

[Bug c++/101515] New: [11/12 Regression] ICE in pp_cxx_unqualified_id, at cp/cxx-pretty-print.c:128

2021-07-19 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101515

Bug ID: 101515
   Summary: [11/12 Regression] ICE in pp_cxx_unqualified_id, at
cp/cxx-pretty-print.c:128
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20210110 and 20210117 :


$ cat z1.cc
struct S
{
  int j;
};
struct T : public S
{
  virtual void h () {}
};
struct ptrmemfunc
{
  void (*ptr) ();
};
typedef void (S::*sp)();
int main ()
{
  T t;
  sp x;
  ptrmemfunc *xp = (ptrmemfunc *) 
  if (xp->ptr != ((void (*)())(sizeof(void *
return 1;
}


$ g++-12-20210718 -c z1.cc -O0 -Wall
$
$ g++-12-20210718 -c z1.cc -O1 -Wall
'
during GIMPLE pass: uninit
In function 'int main()':
Segmentation fault
   14 | int main ()
  | ^~~~
0xd6d5af crash_signal
../../gcc/toplev.c:328
0x7389fc pp_cxx_unqualified_id
../../gcc/cp/cxx-pretty-print.c:128
0x738c48 pp_cxx_unqualified_id
../../gcc/cp/cxx-pretty-print.c:174
0x738ef7 pp_cxx_nested_name_specifier
../../gcc/cp/cxx-pretty-print.c:254
0x7395cb pp_cxx_qualified_id
../../gcc/cp/cxx-pretty-print.c:303
0x8f2e12 print_mem_ref
../../gcc/c-family/c-pretty-print.c:2079
0x76b79d dump_expr
../../gcc/cp/error.c:2403
0x76eb15 expr_to_string(tree_node*)
../../gcc/cp/error.c:3224
0x76f2fc cp_printer
../../gcc/cp/error.c:4390
0x1770e9e pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.c:1475
0x1764d54 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.c:1331
0x176530a diagnostic_impl
../../gcc/diagnostic.c:1493
0x1765862 warning_at(unsigned int, int, char const*, ...)
../../gcc/diagnostic.c:1630
0xf4cf15 maybe_warn_operand
../../gcc/tree-ssa-uninit.c:446
0xf50ece warn_uninitialized_vars
../../gcc/tree-ssa-uninit.c:688
0xf55b23 execute
../../gcc/tree-ssa-uninit.c:3053

[Bug tree-optimization/101512] [11/12 Regression] ICE in maybe_trim_constructor_store, at tree-ssa-dse.c:379

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101512

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|12.0|11.2

[Bug tree-optimization/101512] [11/12 Regression] ICE in maybe_trim_constructor_store, at tree-ssa-dse.c:379

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101512

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/101514] New: ICE: out of memory allocating 18446744073709551600 bytes

2021-07-19 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101514

Bug ID: 101514
   Summary: ICE: out of memory allocating 18446744073709551600
bytes
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   type t
  integer :: a(..)
   end type
   type(t) :: x
   print *, transfer(1, x)
end


$ cat z2.f90
program p
   type t
  integer :: a(..)
   end type
   type(t) :: x
   b = transfer(1, x)
end


$ gfortran-12-20210718 -c z1.f90
z1.f90:3:22:

3 |   integer :: a(..)
  |  1
Error: Array component of structure at (1) must have an explicit shape

f951: out of memory allocating 18446744073709551600 bytes after a total of
618496 bytes

[Bug fortran/101513] New: ICE in gfc_alloc_allocatable_for_assignment, at fortran/trans-array.c:10313

2021-07-19 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101513

Bug ID: 101513
   Summary: ICE in gfc_alloc_allocatable_for_assignment, at
fortran/trans-array.c:10313
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Follow-up of pr100656 :


$ cat z1.f90
subroutine s(x)
   character(:), allocatable, optional :: x(:)
   if ( present(x) ) then
  if ( allocated(x) ) then
 x = ('a' // x // 'e')
  end if
   end if
end


$ cat z2.f90
subroutine s(x)
   character(:), allocatable :: x(:)
   if ( allocated(x) ) then
  x = ('a' // x // 'e')
   end if
end


$ gfortran-12-20210718 -c z1.f90
z1.f90:5:30:

5 |  x = ('a' // x // 'e')
  |  1
internal compiler error: Segmentation fault
0xc9a8df crash_signal
../../gcc/toplev.c:328
0x9ca410 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc/fold-const.c:2394
0x7c7ad6 gfc_alloc_allocatable_for_assignment(gfc_loopinfo*, gfc_expr*,
gfc_expr*)
../../gcc/fortran/trans-array.c:10313
0x7f1f65 gfc_trans_assignment_1
../../gcc/fortran/trans-expr.c:11592
0x7b3287 trans_code
../../gcc/fortran/trans.c:1918
0x821a45 gfc_trans_if_1
../../gcc/fortran/trans-stmt.c:1475
0x8295da gfc_trans_if(gfc_code*)
../../gcc/fortran/trans-stmt.c:1507
0x7b33a7 trans_code
../../gcc/fortran/trans.c:2006
0x821a45 gfc_trans_if_1
../../gcc/fortran/trans-stmt.c:1475
0x8295da gfc_trans_if(gfc_code*)
../../gcc/fortran/trans-stmt.c:1507
0x7b33a7 trans_code
../../gcc/fortran/trans.c:2006
0x7d9ae4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6898
0x760266 translate_all_program_units
../../gcc/fortran/parse.c:6464
0x760266 gfc_parse_file()
../../gcc/fortran/parse.c:6733
0x7ac58f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:216

[Bug c/101512] New: [11/12 Regression] ICE in maybe_trim_constructor_store, at tree-ssa-dse.c:379

2021-07-19 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101512

Bug ID: 101512
   Summary: [11/12 Regression] ICE in
maybe_trim_constructor_store, at tree-ssa-dse.c:379
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20200503 and 20200510 :


$ cat z1.c
int n();
typedef unsigned long V __attribute__ ((vector_size (64)));
V
foo (int i, V v)
{
  i = ((V)(V){n()})[n()];
  return v + i;
}


$ gcc-11-20200503 -c z1.c -O2 -mavx512f
$
$ gcc-12-20210718 -c z1.c -O2 -mavx512f
during GIMPLE pass: dse
z1.c: In function 'foo':
z1.c:8:1: internal compiler error: in maybe_trim_constructor_store, at
tree-ssa-dse.c:379
8 | }
  | ^
0xcf24be maybe_trim_constructor_store
../../gcc/tree-ssa-dse.c:379
0xcf24be maybe_trim_partially_dead_store
../../gcc/tree-ssa-dse.c:605
0xcf24be dse_optimize_stmt
../../gcc/tree-ssa-dse.c:1146
0xcf24be execute
../../gcc/tree-ssa-dse.c:1237

[Bug c/94903] [9 Regression] internal compiler error: in assign_temp, at function.c:982

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94903

Andrew Pinski  changed:

   What|Removed |Added

 CC||gjl at gcc dot gnu.org

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

[Bug inline-asm/80573] ICE: internal compiler error: in assign_temp, at function.c:961

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80573

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #4 from Andrew Pinski  ---
This has been fixed in GCC 10+.  It is very similar to PR 94903 so closing as a
dup.

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

[Bug rtl-optimization/99927] [9/10 only] Wrong code since r11-39-gf9e1ea10e657af9f

2021-07-19 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99927

Segher Boessenkool  changed:

   What|Removed |Added

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

--- Comment #22 from Segher Boessenkool  ---
Fixed everywhere.

[Bug rtl-optimization/99927] [9/10 only] Wrong code since r11-39-gf9e1ea10e657af9f

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99927

--- Comment #21 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Segher Boessenkool
:

https://gcc.gnu.org/g:183a4022a2acfae91cfd861df98697eacfb5c2e5

commit r9-9631-g183a4022a2acfae91cfd861df98697eacfb5c2e5
Author: Segher Boessenkool 
Date:   Sat Apr 17 18:06:17 2021 +

combine: Don't create REG_UNUSED notes if the reg already died (PR99927)

If the register named in an existing REG_UNUSED note dies somewhere
between where the note used to be and I3, we should just drop it.

2021-04-21  Segher Boessenkool  

PR rtl-optimization/99927
* combine.c (distribute_notes) [REG_UNUSED]: If the register
already
is dead, just drop it.

(cherry picked from commit b412ce8e961052e6becea3bc783a53e1d5feaa0f)

[Bug rtl-optimization/99927] [9/10 only] Wrong code since r11-39-gf9e1ea10e657af9f

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99927

--- Comment #20 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Segher Boessenkool
:

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

commit r10-9989-g7ef9f0272258862439348dbaa57a46e9eabdc9ca
Author: Segher Boessenkool 
Date:   Sat Apr 17 18:06:17 2021 +

combine: Don't create REG_UNUSED notes if the reg already died (PR99927)

If the register named in an existing REG_UNUSED note dies somewhere
between where the note used to be and I3, we should just drop it.

2021-04-21  Segher Boessenkool  

PR rtl-optimization/99927
* combine.c (distribute_notes) [REG_UNUSED]: If the register
already
is dead, just drop it.

[Bug c++/100646] [11 Regression] gcc -E -fdirectives-only causes "error: unterminated comment" when no new line at the end of file

2021-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100646

Jakub Jelinek  changed:

   What|Removed |Added

 CC||boris at kolpackov dot net

--- Comment #8 from Jakub Jelinek  ---
*** Bug 101298 has been marked as a duplicate of this bug. ***

[Bug c++/101298] [11/12 Regression] Inclusion of a file without trailing newline breaks -fdirectives-only

2021-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101298

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Jakub Jelinek  ---
I certainly can't reproduce on the trunk with
r12-934-gd15a2d261b24adcbfe5e663b15dde3df5d2b3486 or later or on the 11 branch
since
r11-8490-g3a2fa2e819d4714cecf5048eda2b7e52ba9e3cdd
so it seems to be exact dup.

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

[Bug target/100208] amdgcn fails to build with llvm-mc from llvm12

2021-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100208

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Andrew Stubbs :

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

commit r12-2396-gaad32a00b7d2b64ae158b2b167768a9ae3e20f6e
Author: Andrew Stubbs 
Date:   Thu Jul 8 15:47:53 2021 +0100

amdgcn: Add -mxnack and -msram-ecc [PR 100208]

gcc/ChangeLog:

PR target/100208
* config/gcn/gcn-hsa.h (DRIVER_SELF_SPECS): New.
(ASM_SPEC): Set -mattr for xnack and sram-ecc.
* config/gcn/gcn-opts.h (enum sram_ecc_type): New.
* config/gcn/gcn-valu.md: Add a warning comment.
* config/gcn/gcn.c (gcn_option_override): Add "sorry" for -mxnack.
(output_file_start): Add xnack and sram-ecc state to
".amdgcn_target".
* config/gcn/gcn.md: Add a warning comment.
* config/gcn/gcn.opt: Add -mxnack and -msram-ecc.
* config/gcn/mkoffload.c (EF_AMDGPU_MACH_AMDGCN_GFX908): Remove
SRAM-ECC flag.
(EF_AMDGPU_XNACK): New.
(EF_AMDGPU_SRAM_ECC): New.
(elf_flags): New.
(copy_early_debug_info): Use elf_flags.
(main): Handle -mxnack and -msram-ecc options.
* doc/invoke.texi: Document -mxnack and -msram-ecc.

gcc/testsuite/ChangeLog:

PR target/100208
* gcc.target/gcn/sram-ecc-1.c: New test.
* gcc.target/gcn/sram-ecc-2.c: New test.
* gcc.target/gcn/sram-ecc-3.c: New test.
* gcc.target/gcn/sram-ecc-4.c: New test.
* gcc.target/gcn/sram-ecc-5.c: New test.
* gcc.target/gcn/sram-ecc-6.c: New test.
* gcc.target/gcn/sram-ecc-7.c: New test.
* gcc.target/gcn/sram-ecc-8.c: New test.

[Bug rtl-optimization/99927] [9/10 only] Wrong code since r11-39-gf9e1ea10e657af9f

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99927

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|10.4|9.5
  Known to fail||10.0

  1   2   3   >