[Bug target/116972] _march=x86_64 uses rep instead of see to do the zeroing

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|tree-optimization   |target
Summary|missed vectorization when   |_march=x86_64 uses rep
   |an array of type 'long' is  |instead of see to do the
   |initialized to 0|zeroing

--- Comment #1 from Andrew Pinski  ---
This is not exactly a missed optimization. Rather the default settings for the
generic x86_64 is to use rep stosq for the memset of 0 rather than use the
vector registers to do the zeroing.

If you use different-march= you see that.

[Bug c++/116954] [13/14/15 Regression] format attribute is being lost for function template with a depedent type argument and decl merging since r13-4160-g2efb237ffc68ec

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

--- Comment #5 from Andrew Pinski  ---
(In reply to Sam James from comment #4)
> r13-4160-g2efb237ffc68ec ???

It does touch duplicate_decls which I had assumed might be the issue here.
Duplicate_decls is where the merging of the 2 decls happen and if we remove
either the definition or the declaration we get the format warning.

[Bug rtl-optimization/116968] New: There should be an rtl version of stmt_unremovable_because_of_non_call_eh_p

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116968

Bug ID: 116968
   Summary: There should be an rtl version of
stmt_unremovable_because_of_non_call_eh_p
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: internal-improvement
  Severity: enhancement
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

This came up in the review here:
https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664390.html

```
I don't like these magic flags that every relevant pass has to remember
to check individually.  In practice, the only way they will be checked
is if code is copied-and-pasted between passes (meaning an abstraction
is missing) or by trial and error.

I couldn't find an obvious helper routine for it, though, so I agree
this is the established best practice.
```

On the gimple side we have stmt_unremovable_because_of_non_call_eh_p though it
has been forgot to be checked every once in a while (e.g.
r12-4661-g7518e4c2f0758d ). Maybe there is a better abstraction here for both
rtl and gimple.

[Bug c++/116967] Accepts-invalid missing constinit specifier on initializing declaration

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116967

Andrew Pinski  changed:

   What|Removed |Added

  Known to fail||10.1.0
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-10-04

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

Looks like we just merge it and don't have any diagnostic.

  DECL_DECLARED_CONSTINIT_P (newdecl)
|= DECL_DECLARED_CONSTINIT_P (olddecl);


Shouldn't be too hard to add the required diagnostic to duplicate_decls I
think.

[Bug objc/116966] obj-c++.dg/property/dotsyntax-20.mm test fails after syntax fix

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116966

--- Comment #1 from Andrew Pinski  ---
Comment from the testcase:
  /* Now test some warnings.  */
  object.p1; /* This warning does not seem to be produced in C++.  dg-warning
"value computed is not used" */

[Bug objc/116965] obj-c++.dg/fobjc-std-1.mm test fails after syntax fix

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116965

--- Comment #1 from Andrew Pinski  ---
>contained a dg-* directive syntax issue which meant a directive was being 
>silently ignored.

Yes and that was deliberate, comment from the testcase itself:

/* There is a problem with the testsuite on the following line; the compiler
seems Ok, but the testsuite still barfs.  */

I don't think anyone has looked into the reason why though.

[Bug libstdc++/116964] FAIL: 18_support/comparisons/algorithms/fallback.cc -std=gnu++20 (test for excess errors)

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116964

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||diagnostic

--- Comment #1 from Andrew Pinski  ---
This might be new after r15-4045-gdca2b47916c664 .

[Bug libstdc++/116944] [15 Regression] 17_intro/headers/c++201[14]/parallel_mode.cc fails on aarch64

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116944

Andrew Pinski  changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

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

[Bug libstdc++/116963] FAIL: 17_intro/headers/c++2011/parallel_mode.cc (test for excess errors)

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116963

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This was fixed earlier today.

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

[Bug target/116962] Bad interaction between __attribute__((naked)) and -fstack-protector-all

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116962

--- Comment #1 from Andrew Pinski  ---
maybe naked attribute should imply no_stack_protector attribute (if it is not
already).

[Bug c++/116954] [13/14/15 Regression] format attribute is being lost for function template with a depedent type argument and decl merging

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116954

--- Comment #3 from Andrew Pinski  ---
(In reply to Sam James from comment #2)
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116853#c0

Nice catch.

[Bug c++/116954] [13/14/15 Regression] format attribute is being lost for function template with a depedent type argument and decl merging

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116954

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||needs-bisection
   Target Milestone|--- |13.4

[Bug c++/116954] [13/14/15 Regression] format attribute is being lost for function template with a depedent type argument and decl merging

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116954

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-10-03
 Ever confirmed|0   |1
  Known to work||12.1.0, 12.4.0, 7.1.0,
   ||9.1.0
Summary|-Wsuggest-attribute=format  |[13/14/15 Regression]
   |false positive for function |format attribute is being
   |template|lost for function template
   ||with a depedent type
   ||argument and decl merging
   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
  Known to fail|13.2.0, 13.3.0, 13.3.1, |3.4.6
   |14.1.0, 14.2.0  |

--- Comment #1 from Andrew Pinski  ---
Actually the problem is not with `Wsuggest-attribute=format` but rather the C++
front-end losing the format attribute when it comes to dependent array types
and merging decls.

Take:
```
#ifndef WORKS
template
int fn(char (&buf)[N], const char fmt[], ...)
  __attribute__ ((__format__ (__printf__, 2, 3)));
#endif

template
__attribute__ ((__format__ (__printf__, 2, 3)))
int fn(char (&)[N], const char [], ...)
{ return 0; }

int main()
{
  char buf[20];
  return fn(buf, "%s", 42); /* { dg-warning "Wformat" } */
}
```

This used to work in some versions of GCC but no longer works.

[Bug tree-optimization/105769] [12/13/14/15 Regression] program segmentation fault with -ftree-vectorize and nested lambdas

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105769

--- Comment #22 from Andrew Pinski  ---
Created attachment 59281
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59281&action=edit
Slightly more reduced

Removed iostream. Still need to remove the std::function.

[Bug c++/116960] ICE: Error reporting routines re-entered

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116960

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-10-03

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

[Bug c++/116960] ICE: Error reporting routines re-entered

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116960

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||c++-lambda
 Blocks||107430

--- Comment #1 from Andrew Pinski  ---
>but should just error

Actually it should just warn.

Reduced testcase:
```

template
using Foo = decltype([](auto) { return 0; }(0));

template
Foo<[] {}> foo() {}

auto t = foo();

```


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107430
[Bug 107430] [meta-bug] lambda in decltype

[Bug tree-optimization/105769] [12/13/14/15 Regression] program segmentation fault with -ftree-vectorize and nested lambdas

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105769

--- Comment #21 from Andrew Pinski  ---
Created attachment 59280
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59280&action=edit
Patch which fixes it

This is the patch which is on top of
https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664419.html .

[Bug tree-optimization/105769] [12/13/14/15 Regression] program segmentation fault with -ftree-vectorize and nested lambdas

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105769

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #20 from Andrew Pinski  ---
Note my patch
https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664419.html does not
work as it does not track addresses via vector types. But that might be an easy
change, that is change INTEGRAL_TYPE_P  to ANY_INTEGRAL_TYPE_P and it might
start working.

Let me see if that does help.

[Bug bootstrap/116951] Use -D_GLIBCXX_ASSERTIONS for --enable-checking=yes

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116951

--- Comment #6 from Andrew Pinski  ---
(In reply to Jonathan Wakely from comment #5)
> Not "stl" though please.
> 
> STL != the C++ standard library

Sorry bad habit. maybe stdcxxcontainers instead since most (if not all) is
dealing with the containers in the C++ standard library?

[Bug driver/116957] Creation of pre-compiled header (-x c-header, -x c++-header) confused by linker options (eg -Wl,-g)

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116957

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
This is basically a dup of bug 17001.

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

[Bug driver/17001] Linker option -Wl,foo,bar causes the driver to behave unintuitively for no input files

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17001

Andrew Pinski  changed:

   What|Removed |Added

 CC||earl_chew at yahoo dot com

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

[Bug driver/17001] Linker option -Wl,foo,bar causes the driver to behave unintuitively for no input files

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17001

Andrew Pinski  changed:

   What|Removed |Added

 CC||bitmap at pan dot homelinux.com

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

[Bug driver/21055] Option -Wl,-wrap when no input file

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21055

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #4 from Andrew Pinski  ---
Dup.

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

[Bug libstdc++/116958] std::views::transform loses track of the range size

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116958

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

[Bug libstdc++/116958] std::views::transform loses track of the range size

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116958

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |libstdc++

--- Comment #11 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #9)
> Note I think the fornt-end is producing some odd code here:
> return * = ...
> 
> And that is also confusing some of the optimizers.

Ok, I misread the IR dump because it was not obvious the default definition of
_2 comes from the retval.

Without -all turned on the dump we don't get:
  struct vectorD.98296 & _2(D) = ;

and that had confused me.

[Bug c++/116958] std::views::transform loses track of the range size

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116958

--- Comment #9 from Andrew Pinski  ---
Note I think the fornt-end is producing some odd code here:
return * = ...

And that is also confusing some of the optimizers.

[Bug c++/116958] std::views::transform loses track of the range size

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116958

--- Comment #6 from Andrew Pinski  ---
;; Function
std::ranges::views::__adaptor::_Partial
>::operator()
>, std::ranges::transform_view, std::_Bind_front,
int> > >(this
std::ranges::views::__adaptor::_Partial
>&&, std::ranges::transform_view,
std::_Bind_front, int> >&&):: [with
auto:36 = {}] (null)
;; enabled by -tree-original


{
  struct transform_view & __r [value-expr: ((const struct ._anon_174 *)
__closure)->r];

struct transform_view & __r [value-expr: ((const struct ._anon_174 *)
__closure)->r];
  < = TARGET_EXPR 
(struct transform_view &) __r >>;
}

[Bug c++/116958] std::views::transform loses track of the range size

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116958

Andrew Pinski  changed:

   What|Removed |Added

  Component|libstdc++   |c++
 Status|ASSIGNED|UNCONFIRMED
   Target Milestone|15.0|---
   Last reconfirmed|2024-10-03 00:00:00 |
   Assignee|redi at gcc dot gnu.org|unassigned at gcc dot 
gnu.org
 Ever confirmed|1   |0
 Depends on|111055  |

--- Comment #5 from Andrew Pinski  ---
There is some undefined code going on:


  struct vector & _2(D);

  retvalptr.184_10 = _2(D);



Comes from:
struct vector
std::ranges::views::__adaptor::_Partial
>::operator()
>, std::ranges::transform_view, std::_Bind_front,
int> > >(this
std::ranges::views::__adaptor::_Partial
>&&, std::ranges::transform_view,
std::_Bind_front, int> >&&)operator()<> (const struct ._anon_174 * const __closure)
{
  struct _To2 D.105895;
  struct transform_view & _1;
  struct vector & _4(D);

   :
  _1 = __closure_3(D)->r;
  *_4(D) =
std::ranges::__detail::_To2::operator(),
std::_Bind_front, int> > > (&D.105895, _1); [return slot
optimization]


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111055
[Bug 111055] [C++23] Implement P1206R7, Conversions from ranges to containers

[Bug other/116948] bootstrap-ubsan should set UBSAN_OPTIONS to abort on error

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116948

--- Comment #3 from Andrew Pinski  ---

At the very least there should be a parsing tool for the log to extract the
failures. This will fix the ci issue really and then it is up to the ci to keep
track if things change.

[Bug target/116927] [14/15 Regression] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with -fnon-call-exceptions -fno-delete-dead-exceptions

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

Andrew Pinski  changed:

   What|Removed |Added

  Known to fail|15.0|
  Known to work||15.0

--- Comment #8 from Andrew Pinski  ---
Fixed on the trunk will backport in a few weeks.

[Bug bootstrap/116951] Use -D_GLIBCXX_ASSERTIONS for --enable-checking=yes

2024-10-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116951

--- Comment #3 from Andrew Pinski  ---
Maybe add a new level for checking which can be later on included in yes. At
least then it can easily enabled and even enabled seperately from others. E.g.
someone could do even --enable-checking=release,stl

[Bug c++/116952] Error on lambda NTTP argument to type constraint in template parameter list of generic lambda

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116952

--- Comment #2 from Andrew Pinski  ---
Note even this works:
```
template
concept A = true;

constexpr auto t = [] {};

auto b = []> {};
```

[Bug c++/116952] Error on lambda NTTP argument to type constraint in template parameter list of generic lambda

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116952

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=99478
   Last reconfirmed||2024-10-03
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

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

>From the parser.cc:
  if (cxx_dialect >= cxx20)
{
  /* C++20 allows lambdas in unevaluated context, but one in the type of a
 non-type parameter is nonsensical.

 Distinguish a lambda in the parameter type from a lambda in the
 default argument by looking at local_variables_forbidden_p, which is
 only set in default arguments.  */
  if (processing_template_parmlist && !parser->local_variables_forbidden_p)
{
  error_at (token->location,
"lambda-expression in template parameter type");
  token->error_reported = true;
  ok = false;
}
}

"one in the type of a non-type parameter is nonsensical." Looks like this
forgot about concepts.

[Bug middle-end/110141] [12/13/14/15 Regression] Wrong code at -O2 on x86_64-linux-gnu

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110141

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|12.5|12.4
 Status|NEW |RESOLVED

--- Comment #6 from Andrew Pinski  ---
  # g_45 = PHI  [(void *)&e + 2B](5)>
  # a_44 = PHI 
  # g__lsm0.15_59 = PHI 
  pretmp_58 = MEM[(short int *)g_45 + 2B];


Fixed by the patch which fixed PR 111422.

[Bug middle-end/109967] [12/13/14/15 Regression] Wrong code at -O2 on x86_64-linux-gnu

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109967

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=111422
   Target Milestone|12.5|11.5
 Resolution|--- |FIXED

--- Comment #12 from Andrew Pinski  ---
This was fixed by the same patch which fixed PR 111422.

  ivtmp.19_7 = (unsigned long) &g;
...


   [local count: 89482957]:
  g ={v} {CLOBBER(eol)};
  _51 = e_16 + -1;
  f[_51] = 1;

   [local count: 447307436]:
  # d_36 = PHI 
  # e_37 = PHI 
  # ivtmp.14_28 = PHI 
...


(same BB):
  # ivtmp.14_28 = PHI 
...
  MEM[(char *)_55] = _3;


So we now know that g is alive at the same time f is alive so we know they
conflict.

[Bug tree-optimization/116950] IVopts missed unification of duplicate IVs

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116950

Andrew Pinski  changed:

   What|Removed |Added

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

[Bug tree-optimization/116950] IVopts missed unification of duplicate IVs

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116950

--- Comment #1 from Andrew Pinski  ---
> p.s. even though -ffinite-loops seems to be default at -O2

It is enabled for C++ yes but NOT C by default. That might be the difference
you saw when reducing the code.

[Bug tree-optimization/116949] New: walk_stmt_load_store_addr_ops has extra code to handle comparisons in there

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116949

Bug ID: 116949
   Summary: walk_stmt_load_store_addr_ops has extra code to handle
comparisons in there
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: internal-improvement
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

/* COND_EXPR and VCOND_EXPR rhs1 argument is a comparison
 tree with two operands.  */
  else if (i == 1 && COMPARISON_CLASS_P (op))
{
  if (TREE_CODE (TREE_OPERAND (op, 0)) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 0),
   0), op, data);
  if (TREE_CODE (TREE_OPERAND (op, 1)) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 1),
   0), op, data);
}

I am 99% sure this is now dead code.

[Bug tree-optimization/111276] rewrite_to_defined_overflow rewrites already defined code

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111276

--- Comment #6 from Andrew Pinski  ---
So the reason why the patch for PR111422 used to work is because before we had:
  _43 = _42 + 18446744073709551615;
  _44 = &g + _43;
  *_44 = 8;

But with the change here we get:
  _9 = (unsigned long) &g;
  _84 = _9 + 18446744073709551615;
  _11 = _42 + _84;
  _44 = (signed char *) _11;

Before we walked to _44 but not back further so in the new case we don't look
at _9. I wonder if we could get a case which failed before; though maybe we
don't since we canonicalize `(a ptr+ b) ptr+ c` into `a ptr+ (b + c)`.

[Bug lto/116946] LTO gets confused about code path and incorrectly triggers build-time assertion

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116946

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Plus this is an almost duplicate version of PR 89029 (where there was no LTO
involved either).

[Bug lto/105727] __builtin_constant_p expansion in LTO

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727

Andrew Pinski  changed:

   What|Removed |Added

 CC||jwerner at chromium dot org

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

[Bug lto/116946] LTO gets confused about code path and incorrectly triggers build-time assertion

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116946

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
See PR 105727 and maybe others.

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

[Bug lto/116946] LTO gets confused about code path and incorrectly triggers build-time assertion

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116946

--- Comment #1 from Andrew Pinski  ---
IIRC you can't use __builtin_constant_p in this way ever even without LTO.

[Bug libstdc++/116944] [15 Regression] 17_intro/headers/c++201[14]/parallel_mode.cc fails on aarch64

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116944

Andrew Pinski  changed:

   What|Removed |Added

Summary|[15 Regression] |[15 Regression]
   |17_intro/headers/c++2011/pa |17_intro/headers/c++201[14]
   |rallel_mode.cc fails on |/parallel_mode.cc fails on
   |aarch64 |aarch64

--- Comment #1 from Andrew Pinski  ---
17_intro/headers/c++2014/parallel_mode.cc fails in a similar fashion.

[Bug c++/116943] wrong(?) indication of specialization after (implicit) instantiation

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116943

--- Comment #1 from Andrew Pinski  ---
clang, MSVC and EDG all reject the code for the same reason.

[Bug libstdc++/116944] [15 Regression] 17_intro/headers/c++2011/parallel_mode.cc fails on aarch64

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116944

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |15.0

[Bug libstdc++/116944] New: [15 Regression] 17_intro/headers/c++2011/parallel_mode.cc fails on aarch64

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116944

Bug ID: 116944
   Summary: [15 Regression]
17_intro/headers/c++2011/parallel_mode.cc fails on
aarch64
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: testsuite-fail
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
CC: redi at gcc dot gnu.org
  Target Milestone: ---
Target: aarch64-linux-gnu

We get:
```
In file included from
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/parallel/algobase.h:40,^M
 from
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:2324,^M
 from
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/algorithm:62,^M
 from
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/aarch64-linux-gnu/bits/stdc++.h:51,^M
 from
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/aarch64-linux-gnu/bits/extc++.h:32,^M
 from
/home/apinski/src/upstream-cross-aarch64/gcc/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc:24:^M
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/parallel/base.h:157:
warning: 'template struct
std::binary_function' is deprecated [-Wdeprecated-declarations]^M
In file included from
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/parallel/base.h:36:^M
/home/apinski/src/upstream-cross-aarch64/gcc/objdir-stage2/aarch64-linux-gnu/libstdc++-v3/include/bits/stl_function.h:131:
note: declared here^M

```

This is with r15-4033 .

[Bug target/116927] [14/15 Regression] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with -fnon-call-exceptions -fno-delete-dead-exceptions

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

--- Comment #6 from Andrew Pinski  ---
Created attachment 59271
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59271&action=edit
Patch which I am testing

[Bug target/116940] [15 Regression] wrong code with -O -mavx512vl and vector compare and negation

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116940

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Target Milestone|--- |15.0
   Last reconfirmed||2024-10-02
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Confirmed. Looks related to the removal of the VCONDU patterns.

[Bug target/116927] [14/15 Regression] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with -fnon-call-exceptions -fno-delete-dead-exceptions

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
Mine should be easy to fix as I already gave the outline of what needs to be
done.

[Bug lto/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |lto
   Keywords|c++-lambda  |

--- Comment #25 from Andrew Pinski  ---
https://gcc.gnu.org/pipermail/gcc-patches/2013-June/364471.html looks like it
introduces that line.

[Bug other/116936] [UBSAN] gcc/diagnostic.cc: null pointer passed as argument

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116936

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-02
 Ever confirmed|0   |1
 CC||dmalcolm at gcc dot gnu.org

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

```
int
diagnostic_option_classifier::pch_save (FILE *f)
{
  unsigned int lengths[2] = { m_classification_history.length (),
  m_push_list.length () };
  if (fwrite (lengths, sizeof (lengths), 1, f) != 1
  || fwrite (m_classification_history.address (),
 sizeof (diagnostic_classification_change_t),
 lengths[0], f) != lengths[0]
  || fwrite (m_push_list.address (), sizeof (int),
 lengths[1], f) != lengths[1])
return -1;
  return 0;
}

```

m_classification_history.address can be a null ptr if the length was 0.

Maybe this is a minor issue but still should be fixed.

[Bug tree-optimization/116939] rewrite_to_defined_overflow/gimple_with_undefined_signed_overflow should also rewrite VCEs (from/to integral types) into casts

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116939

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Last reconfirmed||2024-10-02

--- Comment #1 from Andrew Pinski  ---
.

[Bug tree-optimization/116939] New: rewrite_to_defined_overflow/gimple_with_undefined_signed_overflow should also rewrite VCEs (from/to integral types) into casts

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116939

Bug ID: 116939
   Summary: rewrite_to_defined_overflow/gimple_with_undefined_sign
ed_overflow should also rewrite VCEs (from/to integral
types) into casts
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: internal-improvement
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: pinskia at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
Blocks: 116938
  Target Milestone: ---

as mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664260.html and as
implemented in phiopt's move_stmt .


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116938
[Bug 116938] move_stmt in phiopt should use rewrite_to_defined_overflow

[Bug tree-optimization/116938] move_stmt in phiopt should use rewrite_to_defined_overflow

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116938

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-10-02
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Andrew Pinski  ---
.

[Bug tree-optimization/116938] New: move_stmt in phiopt should use rewrite_to_defined_overflow

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116938

Bug ID: 116938
   Summary: move_stmt in phiopt should use
rewrite_to_defined_overflow
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: internal-improvement
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: pinskia at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
Depends on: 111276
  Target Milestone: ---

As mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664260.html .


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111276
[Bug 111276] rewrite_to_defined_overflow rewrites already defined code

[Bug tree-optimization/116937] New: Look better handling of phis in gsi_remove (via remove_phi_node)

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116937

Bug ID: 116937
   Summary: Look better handling of phis in  gsi_remove (via
remove_phi_node)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: internal-improvement
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

As mentioned in the review
https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664272.html :
"maybe we can work towards removing
remove_phi_node and make PHI node handling in gsi_* better"

[Bug tree-optimization/116098] [14 Regression] _Bool value from tagged union is incorrect when built with optimization since r14-1597-g64d90d06d2db43

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116098

Andrew Pinski  changed:

   What|Removed |Added

Summary|[14/15 Regression] _Bool|[14 Regression] _Bool value
   |value from tagged union is  |from tagged union is
   |incorrect when built with   |incorrect when built with
   |optimization since  |optimization since
   |r14-1597-g64d90d06d2db43|r14-1597-g64d90d06d2db43

--- Comment #24 from Andrew Pinski  ---
Fixed fully on the trunk. Will wait a week or 2 before backporting it.

[Bug c++/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

--- Comment #23 from Andrew Pinski  ---
Created attachment 59266
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59266&action=edit
A different reduced testcase

` -std=c++20 --param ggc-min-expand=0 --param ggc-min-heapsize=0 -O3 -flto`

This one requires =0/=0 but I can't reproduce it locally with =0, only =1.

[Bug lto/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

--- Comment #22 from Andrew Pinski  ---
(In reply to Eric Botcazou from comment #21)
> > So the TREE_BLOCK (expr) has been free'd.
> 
> Right.  The TREE_BLOCK for an expression is:
> 
>   if (IS_EXPR_CODE_CLASS (c))
> return LOCATION_BLOCK (t->exp.locus);
> 
> and "locus" is just an integer so the GC marking probably stops there.

That makes me think the location's blocks are not being copied correctly when
it comes to templates. But I could be wrong.

[Bug tree-optimization/116922] [12/13/14 Regression] ICE: in op_iter_init, at ssa-iterators.h:604 with -Ofast

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116922

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||15.0
Summary|[12/13/14/15 Regression]|[12/13/14 Regression] ICE:
   |ICE: in op_iter_init, at|in op_iter_init, at
   |ssa-iterators.h:604 with|ssa-iterators.h:604 with
   |-Ofast  |-Ofast
  Known to fail|15.0|

--- Comment #5 from Andrew Pinski  ---
Fixed on the trunk so far.

[Bug ada/116933] Ada FE incompatible with -ftrivial-auto-var-init=zero (__builtin_clear_padding not folded)

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116933

--- Comment #3 from Andrew Pinski  ---
(In reply to Sam James from comment #2)
> I think this is a secondary problem (tell me if I should file a new PR), but
> we blow up w/ DEFERRED_INIT at -O1:
> ```
> gnatlink hello.ali -ftrivial-auto-var-init=zero -O1
> /usr/lib/gcc/x86_64-pc-linux-gnu/15/adainclude/s-secsta.ads: In function
> ‘system.secondary_stack.ss_stackIP’:
> /usr/lib/gcc/x86_64-pc-linux-gnu/15/adainclude/s-secsta.ads:279:9: error:
> location references block not in block tree
> &"_init"[0]
> SR.41_9 = .DEFERRED_INIT (8, 2, &"_init"[0]);
> during GIMPLE pass: einline
> +===GNAT BUG DETECTED==+
> | 15.0.0 20241001 (experimental) f72b1a44ff582041b02d5abe0a6c8556057e6183
> (x86_64-pc-linux-gnu) GCC error:|
> | verify_gimple failed |
> | Error detected around
> /usr/lib/gcc/x86_64-pc-linux-gnu/15/adainclude/s-secsta.ads:279:9|
> | Compiling /home/sam/build/ada/b~hello.adb|
> ```

That part should be easy to fix.
  location_t loc = EXPR_LOCATION (decl);

...

  if (DECL_NAME (decl))

decl_name = build_string_literal (DECL_NAME (decl));

  else
{
  char decl_name_anonymous[3 + (HOST_BITS_PER_INT + 2) / 3];
  sprintf (decl_name_anonymous, "D.%u", DECL_UID (decl));
  decl_name = build_string_literal (decl_name_anonymous);
}

build_string_literal should take a loc and the loc gets passed to build1 for
the ADDR_EXPR.

[Bug ada/116933] Ada FE incompatible with -ftrivial-auto-var-init=zero (__builtin_clear_padding not folded)

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116933

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||build, link-failure
 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
Thinking about this maybe isel should do the lowering if it was not done by
then.

I wonder it works for other front-ends at -O0 in the first place ...

[Bug c++/116931] False "duplicate 'const'" errors when typedefs used on pointer types in function definitions

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116931

--- Comment #3 from Andrew Pinski  ---
(In reply to Matt Bentley from comment #2)
> Enlighten me here, how is this invalid C++ code?
> Because a typedef should mean that int_pointer is int *, so it should work,
> right? 
> If it's invalid merely because it's typedef'd instead of verbatim, it's a
> language defect.

It is invalid the same way `const int const` is a duplicate const qualifier.

[Bug c++/116931] False "duplicate 'const'" errors when typedefs used on pointer types in function definitions

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116931

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
` const int_pointer const` is a duplicate const.
because int_pointer is one identifier, the const could go before or after to
mean the same thing.

clang produces a warning rather than an error:
:3:37: warning: duplicate 'const' declaration specifier
[-Wduplicate-decl-specifier]


But it is still invalid C++ code.

[Bug driver/116930] 'gcc -v' vs 'gcc --version' have differing formats

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116930

--- Comment #2 from Andrew Pinski  ---
Part of that might be because you use --with-pkgversion= .

[Bug lto/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

--- Comment #20 from Andrew Pinski  ---
#2  0x01271d97 in DFS::DFS_write_tree_body (this=0x7fffd3c0,
ob=0x3f52620, expr=, expr_state=0x3f76060,
ref_p=true) at /home/apinski/src/upstream-gcc/gcc/gcc/lto-streamer-out.cc:1104
1104  DFS_follow_tree_edge (TREE_BLOCK (expr));
(gdb) l
1099
1100  if (CODE_CONTAINS_STRUCT (code, TS_EXP))
1101{
1102  for (int i = 0; i < TREE_OPERAND_LENGTH (expr); i++)
1103DFS_follow_tree_edge (TREE_OPERAND (expr, i));
1104  DFS_follow_tree_edge (TREE_BLOCK (expr));
1105}
1106
1107  if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
1108{
(gdb) p debug_tree(expr)
 
unit-size 
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffe3d8e888 fields  context 
pointer_to_this  reference_to_this
>
unsigned DI
size 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffe3d92f18>

arg:0 

arg:0 
used QI t.cc:106557:16 size 
unit-size 
align:8 warn_if_not_align:0 context  abstract_origin  chain
>
arg:1 
used nonlocal decl_3 QI t.cc:77215:51 size  unit-size 
align:8 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 0
offset 
bit-offset  context
>
t.cc:77223:20 start: t.cc:77223:12 finish: t.cc:77223:23>
t.cc:77223:24 start: t.cc:77223:12 finish: t.cc:77223:51>
$2 = void
(gdb) p debug_generic_expr(expr)
&factory.func

So the TREE_BLOCK (expr) has been free'd.

The original code:
```
template
decltype(auto) operator| (Range&& range, ViewFactory factory)
{
return factory.func(std::forward(range));
}
```
Which is still in the reduced testcase:
```
template 
auto operator|(Range range, Func factory) {
  return factory.func(range);
}
```

[Bug lto/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

Andrew Pinski  changed:

   What|Removed |Added

  Component|ipa |lto

--- Comment #19 from Andrew Pinski  ---
> during IPA pass: modref

Note this just happens to be the last pass that was run right before the
writing out of the LTO summaries. So it is misleading some folks thinking it is
related to modref. I also have not looked to see if we could fix that though.

[Bug ipa/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

--- Comment #18 from Andrew Pinski  ---
So this gc freed memory is somewhere in the BLOCK tree. I have some ideas on
how to go and debug this but I won't be able to get to that until later
tonight.

[Bug ipa/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

--- Comment #17 from Andrew Pinski  ---
Note it worked with r15-1075-g43530bc40b1d04 but I have no idea if it was just
not exposed at that point or not.

[Bug tree-optimization/116922] [12/13/14/15 Regression] ICE: in op_iter_init, at ssa-iterators.h:604 with -Ofast

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116922

--- Comment #3 from Andrew Pinski  ---
Created attachment 59261
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59261&action=edit
Patch which seems to work and am testing

[Bug tree-optimization/116922] [12/13/14/15 Regression] ICE: in op_iter_init, at ssa-iterators.h:604 with -Ofast

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116922

--- Comment #2 from Andrew Pinski  ---
Created attachment 59260
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59260&action=edit
Testcase without vectors

[Bug c++/116928] Error on NTTP with '>' in braced default

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116928

--- Comment #1 from Andrew Pinski  ---
EDG rejects it in a similar fashion as GCC:
"", line 2: error: expected an expression
  template 0 }>
 ^

[Bug target/116927] [14/15 Regression] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with -fnon-call-exceptions -fno-delete-dead-exceptions

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

--- Comment #4 from Andrew Pinski  ---
early_ra::is_dead_insn checks side_effects_p but deletable_insn_p (dce.cc) has
an extra check:

  /* Don't delete insns that may throw if we cannot do so.  */
  if (!(cfun->can_delete_dead_exceptions && can_alter_cfg)
  && !insn_nothrow_p (insn))
return false;

I think is_dead_insn should also have the following:

```
if (cfun->can_delete_dead_exceptions && !insn_nothrow_p (insn))
  return false;
```

That is if -fno-delete-dead-exceptions is there and the insn can throw, the
insn is not dead.

[Bug middle-end/116920] GCC should warn about fall through from a case to a default (without any expressions)

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116920

Andrew Pinski  changed:

   What|Removed |Added

  Component|c   |middle-end
 Ever confirmed|0   |1
Summary|GCC should warn about   |GCC should warn about fall
   |redundant case around   |through from a case to a
   |default in switch   |default (without any
   ||expressions)
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-01

--- Comment #2 from Andrew Pinski  ---
I suspect this might be easy to handle with the other warnings dealing with
fall through.

That is this is a special case of fall through were we want to warn when there
is no statements in between.

[Bug tree-optimization/116922] [12/13/14/15 Regression] ICE: in op_iter_init, at ssa-iterators.h:604 with -Ofast

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116922

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
   Keywords|needs-bisection |
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2024-10-01

--- Comment #1 from Andrew Pinski  ---
Deleting v_17 = PHI <{ 0.0, 0.0, 0.0, 0.0 }(4), v_19(6)>



static void
remove_unused_var (tree var)
{
  gimple *stmt = SSA_NAME_DEF_STMT (var);
  if (dump_file && (dump_flags & TDF_DETAILS))
{
  fprintf (dump_file, "Deleting ");
  print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
  gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
  gsi_remove (&gsi, true);
  release_defs (stmt);
}


That is wrong for phis.

It should have been something like:
  if (gimple_code (t) == GIMPLE_PHI)
{
  remove_phi_node (&gsi, true);
  phiremoved++;
}
  else
{
  unlink_stmt_vdef (t);
  gsi_remove (&gsi, true);
  release_defs (t);
  stmtremoved++;
}

remove_unused_var was added in GCC 6 though; r6-4109-g6a75d560c85508 .

Though backprop didn't start doing something for this testcase until GCC 10.

This should be easy to fix.

I am going to do 2 patches, one to fix remove_unused_var to use the correct way
of removing the phis. And then secondary change the code to use
simple_dce_from_worklist (if I get a chance).

[Bug target/116927] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with fnon-call-exceptions -fharden-control-flow-redundancy -fno-delete-dead-e

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-01
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
> deleting insn with uid = 22.


Hmm, it should not have been removed due to `-fno-delete-dead-exceptions`.

[Bug target/116927] [14/15 Regression] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with -fnon-call-exceptions -fno-delete-dead-exceptions

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.3
Summary|during RTL pass: early_ra:  |[14/15 Regression] during
   |ICE: verify_flow_info   |RTL pass: early_ra: ICE:
   |failed: missing |verify_flow_info failed:
   |REG_EH_REGION note at the   |missing REG_EH_REGION note
   |end of bb 4 with|at the end of bb 4 with
   |fnon-call-exceptions|-fnon-call-exceptions
   |-fharden-control-flow-redun |-fno-delete-dead-exceptions
   |dancy   |
   |-fno-delete-dead-exceptions |
 CC||rsandifo at gcc dot gnu.org
  Known to work||13.3.0

--- Comment #3 from Andrew Pinski  ---
My testcase worked in GCC 13.x (-fharden-control-flow-redundancy is new in GCC
14 but you just need an internal exceptions to get the ICE).

[Bug target/116927] during RTL pass: early_ra: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 4 with fnon-call-exceptions -fharden-control-flow-redundancy -fno-delete-dead-e

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927

--- Comment #2 from Andrew Pinski  ---
Created attachment 59258
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59258&action=edit
Better testcase

`-O2 -fchecking -fnon-call-exceptions -fno-delete-dead-exceptions` is enough
with this C++ one.

[Bug target/116925] [15 regression] ICE when building newton-3.14 with -march=znver2

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116925

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-10-01
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

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

[Bug target/116925] [15 regression] ICE when building newton-3.14 with -march=znver2

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116925

--- Comment #3 from Andrew Pinski  ---
Created attachment 59257
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59257&action=edit
cleaned up reduced testcase

`-mavx -O2 -ffloat-store` is enough to reproduce the issue.

[Bug tree-optimization/116098] [14/15 Regression] _Bool value from tagged union is incorrect when built with optimization since r14-1597-g64d90d06d2db43

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116098

--- Comment #22 from Andrew Pinski  ---
Created attachment 59255
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59255&action=edit
C++ testcase

[Bug tree-optimization/116098] [14/15 Regression] _Bool value from tagged union is incorrect when built with optimization since r14-1597-g64d90d06d2db43

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116098

--- Comment #21 from Andrew Pinski  ---
Created attachment 59254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59254&action=edit
Slightly better testcase

Modified testcase which still depends on SRA. But I will move over to using
bitcast in a few.

[Bug target/116925] [15 regression] ICE when building newton-3.14 with -march=znver2

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116925

--- Comment #1 from Andrew Pinski  ---
Maybe r15-1738-g09737d9605521df9232d9990006c44955064f44e .

[Bug target/116925] [15 regression] ICE when building newton-3.14 with -march=znver2

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116925

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Target Milestone|--- |15.0
 Target||x86_64-linux-gnu

[Bug tree-optimization/116098] [14/15 Regression] _Bool value from tagged union is incorrect when built with optimization since r14-1597-g64d90d06d2db43

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116098

--- Comment #20 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #19)
> Created attachment 59252 [details]
> Patch which I am testing
> 
> This is the simple patch which I mentioned in comment #18 . I still need to
> add testcases.

I forgot to mention it does fix the testcase in comment #15.
```
rewriting stmt with undefined VCE. _4 = VIEW_CONVERT_EXPR<_Bool>(value$8_11);
...
  _4 = (_Bool) value$8_11;
```

[Bug tree-optimization/116098] [14/15 Regression] _Bool value from tagged union is incorrect when built with optimization since r14-1597-g64d90d06d2db43

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116098

--- Comment #19 from Andrew Pinski  ---
Created attachment 59252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59252&action=edit
Patch which I am testing

This is the simple patch which I mentioned in comment #18 . I still need to add
testcases.

[Bug middle-end/116891] [12/13/14/15 Regression] invalid optimization of -fma(-x,x,-z) when -03 and -frounding-math are used

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116891

--- Comment #7 from Andrew Pinski  ---
(In reply to Walter Mascarenhas from comment #6)
> Hi Andrew,
> 
>The proper optimization in this case would be to use the instruction
> vfnmsub132pd followed by a change of sign. It could be something like


That is exactly what I Said just using internals of gcc.

Note bugzilla is usually a mix of both user facing information and internals of
what needs to be done inside gcc.

[Bug c++/116909] Does g++ define the behavior for an "array" manually created with a linker script?

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116909

--- Comment #4 from Andrew Pinski  ---
> Even after reading the other threads, I'm not sure how portable

It works on all targets that gcc supports because r is a generic inline-asm
constraint.

[Bug ipa/116908] ICE (invalid calls_comdat_local flag) with -O1 compiling webkit

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116908

--- Comment #4 from Andrew Pinski  ---
`-std=c++20 -O1 ` is enough for the reduced testcase even on x86_64

[Bug c++/116909] Does g++ define the behavior for an "array" manually created with a linker script?

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116909

--- Comment #5 from Andrew Pinski  ---
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Simple-Constraints.html

Documents the r constraints.

https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Extended-Asm.html#OutputOperands

Documents the `+`.

[Bug ipa/116908] ICE (invalid calls_comdat_local flag) with -O1 compiling webkit

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116908

Andrew Pinski  changed:

   What|Removed |Added

  Attachment #59248|0   |1
is obsolete||

--- Comment #5 from Andrew Pinski  ---
Created attachment 59250
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59250&action=edit
New reduced

`-std=c++2a -O1 -fchecking` fails all the way to GCC 10, fails to compile in
GCC 9.x (due to some C++20ism still)

[Bug ipa/116908] ICE (invalid calls_comdat_local flag) with -O1 compiling webkit

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116908

--- Comment #3 from Andrew Pinski  ---
Created attachment 59248
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59248&action=edit
Reduced as I can get it today

[Bug tree-optimization/116890] Heurstic for factoring out convert with one side constant should also handle when it is a CMP

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116890

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |15.0
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Andrew Pinski  ---
Fixed.

[Bug ipa/116908] [12/13/14/15 Regression] ICE (invalid calls_comdat_local flag) with -O1 compiling webkit

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116908

Andrew Pinski  changed:

   What|Removed |Added

  Known to fail||10.1.0
   Target Milestone|--- |12.5
  Known to work||9.1.0, 9.5.0
Summary|ICE (invalid|[12/13/14/15 Regression]
   |calls_comdat_local flag)|ICE (invalid
   |with -O1 compiling webkit   |calls_comdat_local flag)
   ||with -O1 compiling webkit

[Bug ipa/116908] ICE (invalid calls_comdat_local flag) with -O1 compiling webkit

2024-10-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116908

Andrew Pinski  changed:

   What|Removed |Added

  Attachment #59250|0   |1
is obsolete||

--- Comment #6 from Andrew Pinski  ---
Created attachment 59251
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59251&action=edit
new reduced

Fails with `-O1 -fchecking` . Works in GCC 9.5.0 but fails 10+.

[Bug rtl-optimization/116915] [15 Regression] wrong code at -O{s,2,3} on x86_64-linux-gnu

2024-09-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116915

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Target Milestone|--- |15.0
  Component|tree-optimization   |rtl-optimization
 CC||pinskia at gcc dot gnu.org
   Last reconfirmed||2024-10-01
Summary|wrong code at -O{s,2,3} on  |[15 Regression] wrong code
   |x86_64-linux-gnu|at -O{s,2,3} on
   ||x86_64-linux-gnu
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
-fno-ext-dce fixes it.

[Bug middle-end/77964] [7 Regression] Linux kernel firmware loader miscompiled

2024-09-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77964

--- Comment #24 from Andrew Pinski  ---
(In reply to Jiri Slaby from comment #22)
> (In reply to Andrew Pinski from comment #19)
> > *** Bug 106939 has been marked as a duplicate of this bug. ***
> 
> Provided that many duplicates (even nested -- see that bug too) -- everyone
> expects this to work. Would it be possible for gcc to at least dump a
> warning?

Also see PR 116910 where I recommended we document the proper way of doing this
too.

[Bug ipa/116907] [15 regression] ICE when building kakoune-2024.05.18 with LTO (modref)

2024-09-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||needs-bisection
  Known to fail||15.0
  Known to work||14.2.0

--- Comment #9 from Andrew Pinski  ---
Now I wonder if it is a front-end issue.

If I changed:
return TransformView{(range), 0};

to be:
return TransformView{(range), 0};

then it works but this should be the same thing.

[Bug ipa/116907] [15 regression] ICE when building kakoune-2024.05.18 with LTO (modref)

2024-09-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907

--- Comment #8 from Andrew Pinski  ---
(In reply to Sam James from comment #7)
> Under gdb, I get:
> ```
> during IPA pass: modref
> /tmp/b.ii:81:3: internal compiler error: tree code ‘ggc_freed’ is not
> supported in LTO streams

Something is definitely being freed when it is still in reference. After I
finish reducing this other testcase let me see if I can reduce this one
further.

  1   2   3   4   5   6   7   8   9   10   >