[Bug c++/102799] decltype with lambda without body error cause ICE

2021-10-16 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102799

康桓瑋  changed:

   What|Removed |Added

 CC||hewillk at gmail dot com

--- Comment #2 from 康桓瑋  ---
dup of PR99505 Comment 2.

[Bug c/102800] New: Incorrect UB warning with aggressive-loop-optimizations

2021-10-16 Thread phil at phord dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102800

Bug ID: 102800
   Summary: Incorrect UB warning with
aggressive-loop-optimizations
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: phil at phord dot com
  Target Milestone: ---

I found this spurious warning occurs since gcc 11.1.  It does not occur in 10.3
or previous versions that I tested.

I believe this is a different bug from PR100801 because that bug started
appearing in 9.1.

This bug seems to be very sensitive to changes from this minimal code:
[ Source ]-
/* Compiled with: gcc-11 -O2 -c test.c   */
void bar(char x);
void foo(char * begin)
{
// end = ALIGN(begin, 8);
char * end = begin + 7 - unsigned long)begin) - 1) % 8);

if (begin != end) {
long long x = end - begin;
do bar(x);
while(--x != 0);
}
}

static char buff[1024] = { 0 };
void test(int i)
{
foo(buff + i * 8);
}

[ Compiler output ]-

In function 'void foo(char*)',
inlined from 'void test(int)' at :16:8:
:9:19: warning: iteration 0x8000 invokes undefined behavior
[-Waggressive-loop-optimizations]
9 | while(--x != 0);
  |   ^~~~
:9:19: note: within this loop


Notice we don't enter the loop unless x will be greater than zero because of
the `begin != end` check, and because end >= begin due to the ALIGN math.

The compiled code appears to be correct. Only the spurious warning is a
problem. (In fact, the compiled code is optimized out where the warning is
generated because the inlined function has nothing to do. But the code is
called from elsewhere, so size and correctness matter, of course.)

I found several workarounds:

> Change x to unsigned.  Produces exact same obj output but no warning:
unsigned long long x = end - begin;

> Change x to short (int16_t). Produces exact same obj output but no warning:
short x = end - begin;

> Compare with > 0 instead of != 0. Compiled output is 1 opcode longer:
while(--x > 0);

> Use calculated x value to determine whether to enter loop.
long long x = end - begin;
if (x > 0)
do bar(x);
while(--x != 0);



I just noticed this bug (spurious warning) appears in 9.3 and earlier if I
change this line from != to <:

if (begin < end) {

I guess it is this subtle difference that I think is a new bug. But maybe this
is a dup of PR100801 after all.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475

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

--- Comment #8 from H.J. Lu  ---
Vectorizer has

 if (DR_PTR_INFO (dr)
  && TREE_CODE (addr_base) == SSA_NAME
  && !SSA_NAME_PTR_INFO (addr_base))
vect_duplicate_ssa_name_ptr_info (addr_base, dr_info);

This fixes the crash. 

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 1e13148190c..fca5aebfbdb 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4785,7 +4785,8 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo,
stmt_vec_info stmt_info,

   if (DR_PTR_INFO (dr)
   && TREE_CODE (addr_base) == SSA_NAME
-  && !SSA_NAME_PTR_INFO (addr_base))
+  && !SSA_NAME_PTR_INFO (addr_base)
+  && TREE_CODE (SSA_NAME_VAR (addr_base)) != PARM_DECL)
 vect_duplicate_ssa_name_ptr_info (addr_base, dr_info);

   if (dump_enabled_p ())

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread gcc_bugzilla at axeitado dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #53 from Óscar Fuentes  ---
(In reply to Christoph Reiter from comment #52)
> Turns out this might be fallout from the last grep update, see
> https://github.com/msys2/MINGW-packages/issues/9771#issuecomment-945007372
> Needs investigating..

"this" means the problem with C++ exceptions, which indeed is fixed by building
gcc after reverting to grep 3.0.

The build failure with Ada, which predated the grep upgrade, persists.

Eric: I'm sorry for the time you wasted on this wild goose chase.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475

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

H.J. Lu  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org

--- Comment #7 from H.J. Lu  ---
Looks like a VRP bug.  For:

  [local count: 168730857]:
  if (in_16(D) != 0B) 
goto ; [70.00%]
  else
goto ; [30.00%]

   [local count: 118111600]:
  _1 = size_17(D) + 18446744073709551615;
  out_26 = out_18(D) + _1; 
  goto ; [100.00%]

VRP reports:

in_16(D) : BACK visiting block 3 for in_16(D)
  2->3 has cache, const unsigned char * VARYING, update.
FWD visiting block 3 for in_16(D)  starting range : UNDEFINED
   edge 2->3 :const unsigned char * [1B, +INF]
  Updating range to const unsigned char * [1B, +INF]
  Updating blocks :
DONE visiting blocks for in_16(D)

[Bug c++/102799] decltype with lambda without body error cause ICE

2021-10-16 Thread nickhuang99 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102799

--- Comment #1 from qingzhe huang  ---
Forget to mention that obviously this only happens with "-std=c++20" because of
lambda in unevaluated context support.

[Bug c++/102799] New: decltype with lambda without body error cause ICE

2021-10-16 Thread nickhuang99 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102799

Bug ID: 102799
   Summary: decltype with lambda without body error cause ICE
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

The lambda in outside "decltype" forget to add lambda body which cause ICE
where clang clearly points out this root cause. MSVC++ at least reports error
without crash.


decltype([](decltype([]{}))) gibish;

g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Compiler returned: 4

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread reiter.christoph at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #52 from Christoph Reiter  ---
Turns out this might be fallout from the last grep update, see
https://github.com/msys2/MINGW-packages/issues/9771#issuecomment-945007372
Needs investigating..

[Bug bootstrap/102681] [12 Regression] AArch64 bootstrap failure

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102681

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=102794

--- Comment #6 from Andrew Pinski  ---
I have not looked into the IR here but what could be happening is jump
threading is happening through the loop header and uninitialized code is
getting so confused.

The uninitialized code with respect to conditionals is so fragile with respect
to jump thread; there are other bugs which show that.

[Bug target/102639] ICE in extract_insn, at recog.c:2769 since r12-3406-ga68412117fa47786

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102639

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|--- |12.0

--- Comment #5 from Andrew Pinski  ---
.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475

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

--- Comment #6 from H.J. Lu  ---
A pointer is known to non-null only if we know where the pointer is
pointing to.  Since the null field is initialized to 0, we need to
check both null and anything.  This works on the test case:

diff --git a/gcc/value-query.cc b/gcc/value-query.cc
index ab133aab114..1e8e3b96ea7 100644
--- a/gcc/value-query.cc
+++ b/gcc/value-query.cc
@@ -302,7 +302,7 @@ get_ssa_name_ptr_info_nonnull (const_tree name)
  When PTA analysis is improved, pt.anything, pt.nonlocal
  and pt.escaped may also has to be considered before
  deciding that pointer cannot point to NULL.  */
-  return !pi->pt.null;
+  return !pi->pt.null && !pi->pt.anything;
 }

 // Update the global range for NAME into the SSA_RANGE_NAME_INFO and

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

Andrew Pinski  changed:

   What|Removed |Added

Summary|[9/10/11/12 Regression] |[9/10/11/12 Regression]
   |wrong code with -O3 |wrong code with -O3
   |-fno-tree-pta -mavx512f by  |-fno-tree-pta by r9-2475
   |r9-2475 |

--- Comment #5 from Andrew Pinski  ---
Here is a testcase which fails without -mavx512


typedef __SIZE_TYPE__ size_t;

__attribute__((__noipa__))
void BUF_reverse (unsigned char *out, const unsigned char *in, size_t size)
{
  size_t i;
  if (in)
{
  out += size - 1;
  for (i = 0; i < size; i++)
*out++ = *in++;
}
  else
{
  unsigned char *q;
  char c;
  q = out + size - 1;
  for (i = 0; i < size ; i++)
{
  *out++ = 1;
}
}
}

int
main (void)
{
  unsigned char buf[40];
  unsigned char buf1[40];
  for (unsigned i = 0; i < sizeof (buf); i++)
buf[i] = i;
  BUF_reverse (buf, 0, sizeof (buf));
  for (unsigned i = 0; i < sizeof (buf); i++)
if (buf[i] != 1)
  __builtin_abort ();

  return 0;
}

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |9.5

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||alias

--- Comment #4 from Andrew Pinski  ---

Before the vectorizer:
  unsigned charD.28 * out_18(D) = outD.3197;
  const unsigned charD.28 * in_16(D) = inD.3198;
  size_tD.3196 size_17(D) = sizeD.3199;

After:
  unsigned charD.28 * out_18(D) = outD.3197;
  # PT = anything 
  const unsigned charD.28 * in_16(D) = inD.3198;
  size_tD.3196 size_17(D) = sizeD.3199;



That seems to be causing the issue.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

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

--- Comment #3 from H.J. Lu  ---
Visiting conditional with predicate: if (in_16(D) != 0B)

With known ranges
in_16(D): const unsigned char * [1B, +INF]

1B for lower bound is wrong.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

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

--- Comment #2 from H.J. Lu  ---
192t.thread3 has

  if (in_16(D) != 0B)
goto ; [70.00%]
  else
goto ; [30.00%]

193t.dom3 removed "if (in_16(D) != 0B)".

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

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

--- Comment #1 from H.J. Lu  ---
Source has

__attribute__((__noipa__))
void BUF_reverse (unsigned char *out, const unsigned char *in, size_t size)
{
  size_t i;
  if (in)
{
  out += size - 1;
  for (i = 0; i < size; i++)
*out-- = *in++;
}
  else

We generate

BUF_reverse:
.LFB0:
.cfi_startproc
movq%rdi, %r8
movq%rsi, %rcx
movq%rdx, %rax
testq   %rdx, %rdx   <<< RDX has size, not in.
je  .L28

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

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

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
Summary|[9/10/11/12 Regression] |[9/10/11/12 Regression]
   |wrong code with -O3 |wrong code with -O3
   |-fno-tree-pta -mavx512f |-fno-tree-pta -mavx512f by
   ||r9-2475
 Status|UNCONFIRMED |NEW
 CC||rguenth at gcc dot gnu.org
   Last reconfirmed||2021-10-16
  Component|target  |tree-optimization

[Bug tree-optimization/102796] [12 Regresson] ICE in useless_type_conversion_p at gcc/gimple-expr.c:87 since r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d

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

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #3 from H.J. Lu  ---
On Linux/x86, it also caused:

FAIL: 27_io/ios_base/failure/dual_abi.cc execution test

[Bug tree-optimization/102796] [12 Regresson] ICE in useless_type_conversion_p at gcc/gimple-expr.c:87 since r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d

2021-10-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796

--- Comment #2 from Martin Liška  ---
One more test-case can be seen here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797#c2

[Bug tree-optimization/102796] [12 Regresson] ICE in useless_type_conversion_p at gcc/gimple-expr.c:87 since r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d

2021-10-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796

Martin Liška  changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com

--- Comment #1 from Martin Liška  ---
*** Bug 102797 has been marked as a duplicate of this bug. ***

[Bug middle-end/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org
 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #8 from Martin Liška  ---
Dup.

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

[Bug target/102767] [12 Regression] ICE in rs6000_builtin_vectorization_cost, at config/rs6000/rs6000.c:5216

2021-10-16 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102767

--- Comment #6 from Segher Boessenkool  ---
(In reply to Richard Earnshaw from comment #5)
> We have the type 
>  type  size 
> unit-size 
> and movmisalign pattern is enabled for this.
> 
> but the vectorization cost doesn't handle the case of elements=1, which is
> the case when mode is TImode.
> 
> So I think this is an inconsistency in the rs6000 backend - either add
> costing support for single elements or disable the movmisalign code in this
> case.

But TImode is a scalar type, not a vector type, so it should hit one of the
early-outs at the top of rs6000_builtin_vectorization_cost?

[Bug middle-end/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

David Binderman  changed:

   What|Removed |Added

 CC||amacleod at redhat dot com

--- Comment #7 from David Binderman  ---
Andrew's commit 93ac832f1846e4867aa6537f76f510fab8e3e87d
looks to me to be the culprit.

Adding Andrew for best advice.

[Bug middle-end/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

--- Comment #6 from David Binderman  ---
Range currently seems to be (a10794eafb151b92, 730f52e05a1fb5c8).
Trying 1ba7adabf29eb671. Only 7 revisions left to go.

[Bug middle-end/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

--- Comment #5 from David Binderman  ---
(In reply to David Binderman from comment #4)
> I am trying a git bisect. I frequently get this wrong ;-<
> 
> commit a10794eafb151b92 is being built.

Seems fine, trying 730f52e05a1fb5c8.

[Bug middle-end/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

--- Comment #4 from David Binderman  ---
I am trying a git bisect. I frequently get this wrong ;-<

commit a10794eafb151b92 is being built.

[Bug middle-end/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

Andreas Schwab  changed:

   What|Removed |Added

  Component|c   |middle-end
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-10-16

--- Comment #3 from Andreas Schwab  ---
Also breaks libgo.

during GIMPLE pass: evrp
In function 'cmd/go/internal/modget.resolver.resolveQueries':
go1: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
0x76210f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/tree.c:8739
0xa99187 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/tree.h:3556
0xa99187 useless_type_conversion_p(tree_node*, tree_node*)
../../gcc/gimple-expr.c:87
0xe30d83 verify_gimple_phi
../../gcc/tree-cfg.c:5128
0xe30d83 verify_gimple_in_cfg(function*, bool)
../../gcc/tree-cfg.c:5457
0xced80f execute_function_todo
../../gcc/passes.c:2042
0xcee2a3 execute_todo
../../gcc/passes.c:2096

[Bug c/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

--- Comment #2 from Dmitry G. Dyachenko  ---
r12-4256 PASS
r12- FAIL

$ cat x.ii
struct b {
  b(int);
};
void d() {
  int c = 1;
  do
try {
  b a = 1;
  while (1) {
c++;
a = 1;
  }
} catch (...) {
}
  while (1);
}

$ g++ -fpreprocessed -O2 -std=c++98 -c x.ii
during GIMPLE pass: evrp
x.ii: In function 'void d()':
x.ii:16:1: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
   16 | }
  | ^
0x90e691 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/dimhen/src/gcc_current/gcc/tree.c:8739
0x7fcfb1 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/dimhen/src/gcc_current/gcc/tree.h:3556
0x7fcfb1 useless_type_conversion_p(tree_node*, tree_node*)
/home/dimhen/src/gcc_current/gcc/gimple-expr.c:87
0x169677a verify_gimple_phi
/home/dimhen/src/gcc_current/gcc/tree-cfg.c:5128
0x169677a verify_gimple_in_cfg(function*, bool)
/home/dimhen/src/gcc_current/gcc/tree-cfg.c:5457
0x154ad27 execute_function_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2042
0x154b73c execute_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

$ g++ -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
--enable-libstdcxx-debug
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211015 (experimental) [master r12--ga01704fc45a] (GCC)

[Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324

2021-10-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102720

--- Comment #12 from CVS Commits  ---
The master branch has been updated by Jan Hubicka :

https://gcc.gnu.org/g:99b287b8ef51a0be52f7400879a619dc5f993f31

commit r12-4457-g99b287b8ef51a0be52f7400879a619dc5f993f31
Author: Jan Hubicka 
Date:   Sat Oct 16 14:45:06 2021 +0200

Fix wrong code in ldost-strlen-1.c

gcc/ChangeLog:

PR tree-optimization/102720
* tree-ssa-structalias.c (compute_points_to_sets): Fix producing
of call used and clobbered sets.

[Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f

2021-10-16 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

Bug ID: 102798
   Summary: [9/10/11/12 Regression] wrong code with -O3
-fno-tree-pta -mavx512f
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  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 51616
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51616=edit
auto-reduced testcase (from OpenSSL sources)

$ x86_64-pc-linux-gnu-gcc -O3 -fno-tree-pta -mavx512f testcase.c
$ gdb ./a.out
...
(gdb) r
Starting program: /home/smatz/gcc-bug/58/a.out 

Program received signal SIGSEGV, Segmentation fault.
BUF_reverse (out=, out@entry=0x7fffda60 "", in=, in@entry=0x0, size=size@entry=40) at testcase.c:11
11  *out-- = *in++;
(gdb) disas
Dump of assembler code for function BUF_reverse:
...
   0x00401200 <+96>:and$0xffe0,%r9
   0x00401204 <+100>:   add%rcx,%r9
   0x00401207 <+103>:   nopw   0x0(%rax,%rax,1)
=> 0x00401210 <+112>:   vmovdqu (%rdx),%ymm2
   0x00401214 <+116>:   add$0x20,%rdx
   0x00401218 <+120>:   sub$0x20,%rdi
   0x0040121c <+124>:   vperm2i128 $0x1,%ymm2,%ymm2,%ymm0
...
(gdb) info reg
rax0x2840
rbx0x4013d04199376
rcx0x0 0
rdx0x0 0
...

$ 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-r12-4456-20211016001627-g93d183a5fff-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/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
--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 --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-4456-20211016001627-g93d183a5fff-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211016 (experimental) (GCC)

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread reiter.christoph at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #51 from Christoph Reiter  ---
(In reply to Eric Botcazou from comment #50)
> > Yes, from 2.36.1 to 2.37, but I've already tried reverting that and it
> > didn't help. I'm going to try older versions (of everything) though..
> 
> This could as well be a miscompilation of the linker.  Can you upload ld.exe
> somewhere so that I replace mine with it?

If you happen to have an tool that supports extracting .tar.zst you could take
the .exe from package directly:
https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-binutils-2.37-4-any.pkg.tar.zst

[Bug fortran/102787] ICE in new test case gfortran.dg/reshape_shape_2.f90

2021-10-16 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102787

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW

[Bug fortran/102787] ICE in new test case gfortran.dg/reshape_shape_2.f90

2021-10-16 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102787

Dominique d'Humieres  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-10-16
 Status|UNCONFIRMED |ASSIGNED

--- Comment #4 from Dominique d'Humieres  ---
Confirmed on Darwin too.

[Bug c/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

--- Comment #1 from David Binderman  ---
Reduced C code is

glib_autoptr_cleanup_GdkPaintable(struct _GdkPaintable **_ptr) {
  glib_autoptr_clear_GdkPaintable(*_ptr);
}
glib_autoptr_clear_GdkRGBA(struct _GdkRGBA *_ptr) {
  if (_ptr)
gdk_rgba_free();
}
glib_autoptr_cleanup_GdkRGBA(struct _GdkRGBA **_ptr) {
  glib_autoptr_clear_GdkRGBA(*_ptr);
}
gtd_sidebar_list_row_set_property() {
  __attribute__((cleanup(glib_autoptr_cleanup_GdkPaintable))) *paintable = 0;
  __attribute__((cleanup(glib_autoptr_cleanup_GdkRGBA))) *color = 0;
  color = gtd_task_list_get_color();
  paintable = gtd_create_circular_paintable();
  gtk_image_set_from_paintable();
}

Flag -march=bdver2 not required for the reduced code, only  -O2 -fexceptions.

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #50 from Eric Botcazou  ---
> Yes, from 2.36.1 to 2.37, but I've already tried reverting that and it
> didn't help. I'm going to try older versions (of everything) though..

This could as well be a miscompilation of the linker.  Can you upload ld.exe
somewhere so that I replace mine with it?

[Bug c/102797] New: ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

Bug ID: 102797
   Summary: ice in useless_type_conversion_p, at gimple-expr.c:87
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 51615
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51615=edit
gzipped C source code

For the attached C code, recent gcc trunk does this:

../src/plugins/task-lists-workspace/gtd-sidebar-list-row.c:264:1: internal
compiler error: tree check: expected class ‘type’, have ‘exceptional’
(error_mark) in useless_type_conversion_p, at gimple-expr.c:87

Flags -w -march=bdver2 -O2 -fexceptions required.

The bug first seems to occur between git hash be072bfa5bb38171
and 93d183a5fff92d80, so about 27 revisions.

I have a reduction running in the other window now.

[Bug tree-optimization/102796] [12 Regresson] ICE in useless_type_conversion_p at gcc/gimple-expr.c:87 since r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d

2021-10-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-10-16
 Status|UNCONFIRMED |NEW
  Known to work||11.2.0
  Known to fail||12.0
   Target Milestone|--- |12.0
   Priority|P3  |P1

[Bug tree-optimization/102796] New: [12 Regresson] ICE in useless_type_conversion_p at gcc/gimple-expr.c:87 since r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d

2021-10-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796

Bug ID: 102796
   Summary: [12 Regresson] ICE in useless_type_conversion_p at
gcc/gimple-expr.c:87 since
r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: aldyh at gcc dot gnu.org, amacleod at redhat dot com
  Target Milestone: ---

The following fails:

$ cat /home/marxin/Programming/testcases/ice.cpp
namespace std {
template 
struct initializer_list {
  const int* __begin_;
  decltype(sizeof(int)) __size_;
};
}  // namespace std
struct destroyme1 {};
struct witharg1 {
  witharg1(const destroyme1&);
  ~witharg1();
};
std::initializer_list globalInitList2 = {witharg1(destroyme1()),
 witharg1(destroyme1())};

$ ./xg++ -B. /home/marxin/Programming/testcases/ice.cpp -fno-tree-ccp
-fno-tree-fre -fno-tree-forwprop -O3 -c
during GIMPLE pass: evrp
/home/marxin/Programming/testcases/ice.cpp: In function ‘void
__static_initialization_and_destruction_0(int, int)’:
/home/marxin/Programming/testcases/ice.cpp:14:65: internal compiler error: tree
check: expected class ‘type’, have ‘exceptional’ (error_mark) in
useless_type_conversion_p, at gimple-expr.c:87
   14 |  witharg1(destroyme1())};
  | ^
0x178e0aa tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/marxin/Programming/gcc/gcc/tree.c:8739
0x90f81e tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/marxin/Programming/gcc/gcc/tree.h:3556
0x90f81e useless_type_conversion_p(tree_node*, tree_node*)
/home/marxin/Programming/gcc/gcc/gimple-expr.c:87
0x149498c verify_gimple_phi
/home/marxin/Programming/gcc/gcc/tree-cfg.c:5128
0x149498c verify_gimple_in_cfg(function*, bool)
/home/marxin/Programming/gcc/gcc/tree-cfg.c:5457
0x1356421 execute_function_todo
/home/marxin/Programming/gcc/gcc/passes.c:2042
0x1355229 do_per_function
/home/marxin/Programming/gcc/gcc/passes.c:1687
0x1356654 execute_todo
/home/marxin/Programming/gcc/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

And it also blocks bootstrap (fails in libgo).

[Bug tree-optimization/102679] Failure to optimize out 64-bit multiplication to 32-bit multiplication when possible in circumstances involving modifying a 64-bit variable that gets converted to 32-bit

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102679

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-10-16

--- Comment #2 from Andrew Pinski  ---
So GCC is able to do this in a few cases on the RTL level, just not when
loading from memory.
Take:
#include 
int32_t f();

int32_t mac(int32_t *b, int64_t sqr)
{
int64_t t = f();
sqr += t * t;
return sqr;
}
 CUT 
GCC produces exactly what you wanted:
callf()
imull   %eax, %eax
addl%ebx, %eax

Even though at the gimple level we get:
  t_5 = (int64_t) _4;
  _1 = t_5 * t_5;
  sqr_7 = _1 + sqr_6(D);
  _8 = (int32_t) sqr_7;

Of course this gets more complex.

Maybe someone can help me understand combine for a second we for the 2->2 case,
we don't do the transformation if the mode changes but the two operations stay
the same:
Trying 10 -> 12:
   10: {r90:DI=r84:DI*r84:DI;clobber flags:CC;}
  REG_DEAD r84:DI
  REG_UNUSED flags:CC
   12: r89:SI=r90:DI#0+r88:DI#0
  REG_DEAD r88:DI
  REG_DEAD r90:DI
Failed to match this instruction:
(set (reg:SI 89 [ sqr ])
(plus:SI (mult:SI (subreg:SI (reg/v:DI 84 [ t ]) 0)
(subreg:SI (reg/v:DI 84 [ t ]) 0))
(subreg:SI (reg/v:DI 88 [ sqr ]) 0)))

If we did allow that, then the *b case would work on the RTL.

To do this at the gimple level, we would need to introduce non-overflow based
operations or have a lower gimple where signedness does not matter except for
some operators (divide, mod and some shifts).

[Bug tree-optimization/102795] RFE: recognize !! vs branch similarity better

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102795

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Last reconfirmed||2021-10-16
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
   Severity|normal  |enhancement

--- Comment #1 from Andrew Pinski  ---
Mine.
For p2:
  if (_1 == 0)
goto ; [34.00%]
  else
goto ; [66.00%]

   [local count: 365072224]:
  _8 = x_6(D) - _10;
  goto ; [100.00%]

   [local count: 708669601]:
  _11 = x_6(D) + 18446744073709551615;
  _7 = _11 - _10;

   [local count: 1073741824]:
  # _5 = PHI <_8(3), _7(4)>

this could be transformed to (which is almost p3):
  if (_1 == 0)
goto ; [34.00%]
  else
goto ; [66.00%]

   [local count: 708669601]:
  _11 = x_6(D) + 18446744073709551615;

   [local count: 1073741824]:
  # _n = PHI 
  _5 = _n - _10

And then transfomed to:
  if (_1 == 0)
goto ; [34.00%]
  else
goto ; [66.00%]

   [local count: 708669601]:

   [local count: 1073741824]:
  # _n = PHI <0(2), -1(4)>
  _n0 = x_6(D) + _n
  _5 = _n0 - _10

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #49 from Eric Botcazou  ---
> Fore completeness: The "exceptions not working" problem now also crept into
> our v10.3 build with the last rebuild. Maybe some dependency change in the
> last two months, but no idea :/
> 
> https://github.com/msys2/MINGW-packages/issues/9771

I can confirm that the libstdc++ DLL available from there is broken in exactly
the same way as the one from GCC 11: it fails to register its unwinding tables,
i.e. the call to __register_frame_info on startup is missing.  That's managed
by the pair of crtbegin.o/ctrend.o object files from the compiler but the
intermediate __gcc_register_frame is never called.

[Bug tree-optimization/102795] New: RFE: recognize !! vs branch similarity better

2021-10-16 Thread jengelh at inai dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102795

Bug ID: 102795
   Summary: RFE: recognize !! vs branch similarity better
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jengelh at inai dot de
  Target Milestone: ---

Input
=

unsigned long p1(unsigned long x)
{
return x - x / 10 - !!(x % 10);
}
unsigned long p2(unsigned long x)
{
if (x % 10 == 0)
return x - x / 10;
return x - x / 10 - 1;
}
unsigned long p3(unsigned long x)
{
unsigned long z = x - x / 10;
if (x % 10)
--z;
return z;
}

Outcome
===

► ./host-x86_64-pc-linux-gnu/gcc/xg++ -B ./host-x86_64-pc-linux-gnu/gcc -c -O3
-v t.cpp
GNU C++17 (GCC) version 12.0.0 20211016 (experimental) (x86_64-pc-linux-gnu)
compiled by GNU C version 11.2.1 20210816 [revision
056e324ce46a7924b5cf10f61010cf9dd2ca10e9], GMP version 6.2.1, MPFR version
4.1.0-p7, MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

► objdump -Mintel -d t.o
 <_Z2p1m>:
...
  24:   0f 95 c2setne  dl
  27:   0f b6 d2movzx  edx,dl
  2a:   48 29 d0subrax,rdx
...

0030 <_Z2p2m>:
...
  4f:   48 29 d6subrsi,rdx
  52:   48 29 d0subrax,rdx
  55:   48 01 c9addrcx,rcx
  58:   48 39 cfcmprdi,rcx
  5b:   48 0f 44 c6 cmove  rax,rsi
...

0060 <_Z2p3m>:
...
  81:   48 29 d7subrdi,rdx
  84:   48 83 ff 01 cmprdi,0x1
  88:   48 83 d0 ff adcrax,0x
...


Expected outcome


I would have hoped that the optimizer were able to reduce p1, p2 and p3 to the
same asm.

[Bug tree-optimization/102646] [12 Regression] large performance changes between 1932e1169a236849f5e7f1cd386da100d9af470f and 9cfb95f9b92326e86e99b50350ebf04fa9cd2477 (probably jump threading)

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102646

Andrew Pinski  changed:

   What|Removed |Added

Summary|large performance changes   |[12 Regression] large
   |between |performance changes between
   |1932e1169a236849f5e7f1cd386 |1932e1169a236849f5e7f1cd386
   |da100d9af470f and   |da100d9af470f and
   |9cfb95f9b92326e86e99b50350e |9cfb95f9b92326e86e99b50350e
   |bf04fa9cd2477 (probably |bf04fa9cd2477 (probably
   |jump threading) |jump threading)
   Target Milestone|--- |12.0

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread reiter.christoph at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #48 from Christoph Reiter  ---
(In reply to Eric Botcazou from comment #47)
> > Yes, everything is checksummed in our build script. We apply various patches
> > and backports, they are also checksummed:
> > https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD
> 
> Did you change binutils, in particular the linker, in between?

Yes, from 2.36.1 to 2.37, but I've already tried reverting that and it didn't
help. I'm going to try older versions (of everything) though..

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #47 from Eric Botcazou  ---
> Yes, everything is checksummed in our build script. We apply various patches
> and backports, they are also checksummed:
> https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD

Did you change binutils, in particular the linker, in between?

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread reiter.christoph at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #46 from Christoph Reiter  ---
(In reply to Eric Botcazou from comment #45)
> > Fore completeness: The "exceptions not working" problem now also crept into
> > our v10.3 build with the last rebuild. Maybe some dependency change in the
> > last two months, but no idea :/
> > 
> > https://github.com/msys2/MINGW-packages/issues/9771
> 
> Can you confirm that this is with the same compiler sources as the previous
> 10.3 version that works?  Do you apply local changes to them?

Yes, everything is checksummed in our build script. We apply various patches
and backports, they are also checksummed:
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD

[Bug ada/100486] Ada build fails for 32bit Windows

2021-10-16 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

--- Comment #45 from Eric Botcazou  ---
> Fore completeness: The "exceptions not working" problem now also crept into
> our v10.3 build with the last rebuild. Maybe some dependency change in the
> last two months, but no idea :/
> 
> https://github.com/msys2/MINGW-packages/issues/9771

Can you confirm that this is with the same compiler sources as the previous
10.3 version that works?  Do you apply local changes to them?

[Bug tree-optimization/102794] [12 Regression] missing vrp in evrp dealing with casts and ands

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102794

--- Comment #3 from Andrew Pinski  ---
(In reply to Aldy Hernandez from comment #2)
> I haven't looked at this, but there's a pending patch with more
> restrictions for loop threading in the presence of loops.  Does this help?
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581637.html
> 
> We really shouldn't be destroying loop info.

Yes I think it does, though I have not tried it.
There was a jump threading here:
   :
  if (d_10 != 0)
goto ; [INV]
  else
goto ; [INV]

   :
  foo ();

   :
  a_12 = a_3 + 1;

   : ;;; loop header
  # a_3 = PHI <-100(2), a_12(6)>
  if (a_3 != 0)
goto ; [INV]
  else
goto ; [INV]

where d_10 is defined as:
  d_10 = (short unsigned int) a_3;


So yes blocking jumping through the loop header would help.
It is very similar to your f3 in ssa-thread-invalid.c testcase.

[Bug c/46116] Allow passing of anonymous aggregates when signature matches

2021-10-16 Thread muecker at gwdg dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46116

Martin Uecker  changed:

   What|Removed |Added

 CC||muecker at gwdg dot de

--- Comment #3 from Martin Uecker  ---
I have a(very preliminary) patch  here:
https://github.com/uecker/gcc/tree/tagcompat

It implements an option -ftagcompat that makes structs with same tag (or no
tag) and content compatible as proposed in N2366.

[Bug tree-optimization/102794] [12 Regression] missing vrp in evrp dealing with casts and ands

2021-10-16 Thread aldyh at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102794

--- Comment #2 from Aldy Hernandez  ---
I haven't looked at this, but there's a pending patch with more
restrictions for loop threading in the presence of loops.  Does this help?

https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581637.html

We really shouldn't be destroying loop info.


On Sat, Oct 16, 2021, 07:01 pinskia at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102794
>
> Andrew Pinski  changed:
>
>What|Removed |Added
>
> 
>  CC||aldyh at gcc dot gnu.org
>
> --- Comment #1 from Andrew Pinski  ---
> Jump threading really messes up the loop here ...
> about to thread: path: 4 -> 6, 6 -> 7, 7 -> 3,
> just threaded: path: 4 -> 9, 6 -> 7, 7 -> 3,
>
> I don't know what else to say.  Maybe move ethread after evpr?
>
> Note with -fno-thread-jumps, evpr is able to figure out the induction
> variable
> goes from [-100, -1] .  It does look like jump threading is full on
> messing up
> how induction variable detection works; we get two a = a +1; statement
> after
> the jump threading improvements.
> Maybe there is another bug about that case already.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
>

[Bug middle-end/102492] [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205

2021-10-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102492

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Jakub Jelinek  ---
Should be fixed now.