[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Peter Bergner :

https://gcc.gnu.org/g:1ae1325f24cea1698b56e4299d95446a1f7b90a2

commit r13-2239-g1ae1325f24cea1698b56e4299d95446a1f7b90a2
Author: Peter Bergner 
Date:   Sat Aug 27 19:44:16 2022 -0500

rs6000: Allow conversions of MMA pointer types [PR106017]

GCC incorrectly disables conversions between MMA pointer types, which
are allowed with clang.  The original intent was to disable conversions
between MMA types and other other types, but pointer conversions should
have been allowed.  The fix is to just remove the MMA pointer conversion
handling code altogether.

gcc/
PR target/106017
* config/rs6000/rs6000.cc (rs6000_invalid_conversion): Remove
handling
of MMA pointer conversions.

gcc/testsuite/
PR target/106017
* gcc.target/powerpc/pr106017.c: New test.

[Bug fortran/100136] [11/12/13 Regression] ICE, regression, using flag -fcheck=pointer

2022-08-27 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100136

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #6 from anlauf at gcc dot gnu.org ---
(In reply to José Rui Faustino de Sousa from comment #3)
> Only handles the ICE...
> 
> Patch posted:
> 
> https://gcc.gnu.org/pipermail/fortran/2021-April/055949.html

Hi Jose,

unfortunately it appears that your patch was never reviewed,
and you did not ping it.

I think the patch is mostly fine, but that it should use
POINTER_TYPE_P (TREE_TYPE (tmp)), so that it reads (adjusted to mainline):

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 850007fd2e1..e35ea2fc790 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -7220,16 +7220,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
  else
goto end_pointer_check;

+ tmp = parmse.expr;
  if (fsym && fsym->ts.type == BT_CLASS)
{
- tmp = build_fold_indirect_ref_loc (input_location,
- parmse.expr);
+ if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+   tmp = build_fold_indirect_ref_loc (input_location, tmp);
  tmp = gfc_class_data_get (tmp);
  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
tmp = gfc_conv_descriptor_data_get (tmp);
}
- else
-   tmp = parmse.expr;

  /* If the argument is passed by value, we need to strip the
 INDIRECT_REF.  */

Are you still working on gfortran?  Or should I pick up your patch and resubmit
for you?

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #9 from Peter Bergner  ---
(In reply to Peter Bergner from comment #7)
> I think we just want to remove the entire section in
> rs6000_invalid_conversion() that checks the XOmode/OOmode pointer
> conversions.  Doing that fixes the ICE and fixes the PR106015 ICE too.  I'm
> doing a bootstrap and regtest of that patch now.

Testing was clean, so I'll submit the patch.

[Bug target/106015] [PowerPC] pointer to MMA accumulator not convertible to char pointer

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106015

Peter Bergner  changed:

   What|Removed |Added

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

--- Comment #4 from Peter Bergner  ---
Having looked at PR106017, this is a dup of that.  Closing.

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

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #8 from Peter Bergner  ---
*** Bug 106015 has been marked as a duplicate of this bug. ***

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #7 from Peter Bergner  ---
I think we just want to remove the entire section in
rs6000_invalid_conversion() that checks the XOmode/OOmode pointer conversions. 
Doing that fixes the ICE and fixes the PR106015 ICE too.  I'm doing a bootstrap
and regtest of that patch now.

[Bug target/106015] [PowerPC] pointer to MMA accumulator not convertible to char pointer

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106015

--- Comment #3 from Peter Bergner  ---
I think we just want to remove the entire section in
rs6000_invalid_conversion() that checks the XOmode/OOmode pointer conversions. 
Doing that fixes the ICE and fixes the PR106015 ICE too.  I'm doing a bootstrap
and regtest of that patch now.

[Bug libstdc++/106761] New: [13 regression] g++.dg/modules/xtreme-header-*_b.C test cases fails after r13-2158-g02f6b405f0e9dc

2022-08-27 Thread seurer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106761

Bug ID: 106761
   Summary: [13 regression] g++.dg/modules/xtreme-header-*_b.C
test cases fails after r13-2158-g02f6b405f0e9dc
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:02f6b405f0e9dc7a8868fecef9a048b79c433125, r13-2158-g02f6b405f0e9dc

make  -k check-gcc RUNTESTFLAGS="modules.exp=xtreme-header-2*"
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++17 (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
# of expected passes9
# of unexpected failures3

There are some other ones that fail too.  Here is the complete list:

FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++17 (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-4_b.C -std=c++17 (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-4_b.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-4_b.C -std=c++2b (test for excess errors)
FAIL: g++.dg/modules/xtreme-header_b.C -std=c++17 (test for excess errors)
FAIL: g++.dg/modules/xtreme-header_b.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header_b.C -std=c++2b (test for excess errors)


spawn -ignore SIGHUP
/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/g++48/../../xg++
-B/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/g++48/../../
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2_b.C
-fdiagnostics-plain-output -nostdinc++
-I/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/powerpc64le-unknown-linux-gnu
-I/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include
-I/home/seurer/gcc/git/gcc-test/libstdc++-v3/libsupc++
-I/home/seurer/gcc/git/gcc-test/libstdc++-v3/include/backward
-I/home/seurer/gcc/git/gcc-test/libstdc++-v3/testsuite/util -fmessage-length=0
-std=c++2a -pedantic-errors -Wno-long-long -fmodules-ts -fno-module-lazy -S -o
xtreme-header-2_b.s^M
In file included from
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/functional:54,^M
 from
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2.h:6,^M
 from
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H:4,^M
of module
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H,
imported at
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2_b.C:4:^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:560:15:
error: conflicting global module declaration 'template using
std::_TupleConstraints
>::__convertible = std::__and_...>'^M
In file included from
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/functional:54,^M
 from
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2.h:6,^M
 from
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/modules/xtreme-header-2_b.C:3:^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:560:15:
note: existing declaration 'template using
std::_TupleConstraints
>::__convertible = std::__and_...>'^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:557:15:
error: conflicting global module declaration 'template using
std::_TupleConstraints
>::__constructible = std::__and_...>'^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:557:15:
note: existing declaration 'template using
std::_TupleConstraints
>::__constructible = std::__and_...>'^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:560:15:
error: conflicting global module declaration 'template using
std::_TupleConstraints::__convertible =
std::__and_...>'^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:560:15:
note: existing declaration 'template using
std::_TupleConstraints::__convertible =
std::__and_...>'^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:557:15:
error: conflicting global module declaration 'template using
std::_TupleConstraints::__constructible =
std::__and_...>'^M
/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/tuple:557:15:
note: existing declaration 'template using
std::_TupleConstraint

[Bug c++/106760] ICE: tree check: expected function_decl, have template_decl in get_fndecl_argument_location, at cp/call.cc:7801

2022-08-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106760

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-checking
   Severity|normal  |trivial

--- Comment #1 from Andrew Pinski  ---
I suspect this is a regression from GCC 11 but since the ICE only happens with
checking it is a very minor one.

[Bug c++/106760] New: ICE: tree check: expected function_decl, have template_decl in get_fndecl_argument_location, at cp/call.cc:7801

2022-08-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106760

Bug ID: 106760
   Summary: ICE: tree check: expected function_decl, have
template_decl in get_fndecl_argument_location, at
cp/call.cc:7801
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hewillk at gmail dot com
  Target Milestone: ---

struct S {
  template int f();
  int g() const { return f(); }
};

int main() { S().g(); }

https://godbolt.org/z/vcdK4h1Kj

[Bug target/106736] [13 Regression] ICE in gen_movxo, at config/rs6000/mma.md:333

2022-08-27 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106736

--- Comment #7 from Kewen Lin  ---
(In reply to Peter Bergner from comment #5)
> (In reply to Kewen Lin from comment #4)
> > Thanks for the comments! One patch guarding these types is attached, it can
> > fix the ICE.
> 
> That won't work, because that's what we used to do! :-)   In PR96125, the
> test case there is compiled with -mcpu=power8, but uses a pragma/target
> attribute to compile a function with -mcpu=power10/-mmma.  The problem is
> that built-in and target type initialization is only done once, so we can't
> tell from the explicit options being used, whether there will be a function
> later that uses a pragma/target attribute, so we have to assume there will
> be.
> 

aha, good point! Yeah, then the patch is wrong.

> Therefore, we have to always initialize them as we do now, but somehow later
> catch any illegal usage.  Ideas on how to do that welcome! :-)

> ...and we actually do catch the illegal usage, but how we can fail
> gracefully instead of an ICE is what we need to figure out.  Maybe similar
> to your PR103353, we just need the mov[xo]o patterns to succeed temporarily
> so we can fail gracefully later?

Good idea! Btw if changing the current unreachable to FAIL, it will expand as
multiple words without errors, but it's unexpected as we don't want the types
to be used like that. Maybe we can use an "error" for this kind of usage
instead of the current unreachable, will have a further look.

[Bug c++/106655] [C++23] P2295 - Support for UTF-8 as a portable source file encoding

2022-08-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106655

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Created attachment 53516
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53516&action=edit
gcc13-pr106655.patch

Untested patch to add -Winvalid-utf8 warning about invalid UTF-8 byte sequences
in comments.  In identifiers or string literals this is already diagnosed
elsewhere.  Not really sure if the warning should be on by default if
-finput-charset=UTF-8 is used and C++23 pedantic.

[Bug tree-optimization/106737] [13 Regression] ICE: verify_ssa failed (error: stmt with wrong VUSE)

2022-08-27 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106737

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

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

commit r13-2235-g4d291ca6a48f3f51b8ab8452fe2166f021ee
Author: Jakub Jelinek 
Date:   Sat Aug 27 09:28:02 2022 +0200

Require fgraphite effective target for pr106737.c test [PR106737]

The test uses -floop-parallelize-all which emits a sorry when graphite
isn't configured in.

2022-08-27  Jakub Jelinek  

PR tree-optimization/106737
* gcc.dg/autopar/pr106737.c: Require fgraphite effective target.

[Bug middle-end/106427] -Wuse-after-free=3 false alarm about int (not pointer) variable

2022-08-27 Thread simon at josefsson dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106427

Simon Josefsson  changed:

   What|Removed |Added

 CC||simon at josefsson dot org

--- Comment #1 from Simon Josefsson  ---
I ran into this problem too, here is a simple reproducer:

$ gcc -Werror -Wuse-after-free=3 -g -O2 -o foo foo.c
foo.c: In function 'main':
foo.c:18:6: error: pointer may be used after 'free' [-Werror=use-after-free]
   18 |   if (strstr (in, "FOO"))
  |  ^
foo.c:21:3: note: call to 'free' here
   21 |   free (in);
  |   ^
cc1: all warnings being treated as errors

#include 
#include 

extern int readln (char **out);

int
main (void)
{
  char *in = NULL;
  int i = 0;

  if (!readln (&in))
return 0;

  if (in == NULL)
return 0;

  if (strstr (in, "FOO"))
i = 1;

  free (in);
  in = NULL;

  if (!readln (&in))
return 0;

  if (in == NULL)
return 0;

  free (in);

  return i;
}