https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115278

--- Comment #13 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 6 Aug 2024, amylaar at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115278
> 
> Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |amylaar at gcc dot gnu.org
> 
> --- Comment #12 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
> On a newlib based toolchain with gcc 14.2, the test fails:
> 
> Excess errors:
> /home/amylaar/riscy-ip/gcc14/gcc/trunk/gcc/gcc/testsuite/g++.dg/vect/pr115278.cc:24:28:
> error: invalid conversion from 'volatile unsigned int*' to 'volatile 
> uint32_t*'
> {aka 'volatile long unsigned int*'} [-fpermissive]
> 
> g++.dg/vect/pr115278.cc  -std=c++14 : dump file does not exist
> 
> excerpt from the preprocessed file:
> 
> # 37
> "/home/amylaar/riscy-ip/gcc14/gcc/trunk/gcc/newlib/libc/include/machine/_default_types.h"
> 3 4
> extern "C" {
> ...
> # 77
> "/home/amylaar/riscy-ip/gcc14/gcc/trunk/gcc/newlib/libc/include/machine/_default_types.h"
> 3 4
> typedef long int __int32_t;
> 
> typedef long unsigned int __uint32_t;
> ...
> # 15
> "/home/amylaar/riscy-ip/gcc14/gcc/trunk/gcc/newlib/libc/include/sys/_stdint.h"
> 3 4
> extern "C" {
> ...
> typedef __uint32_t uint32_t ;
> 
> 
> I tried to add -fpermissive, but that still gives a warning that ends up as
> excess errors. 
> There doesn't seem to be any specific option to suppress this warning, just 
> -w.
> 
> So, should we add:
> // { dg-additional-options "-fpermissive -w"  { target newlib } }
> 
> 
> or should we do something like:
> 
> Index: g++.dg/vect/pr115278.cc
> ===================================================================
> --- g++.dg/vect/pr115278.cc     (revision 6673)
> +++ g++.dg/vect/pr115278.cc     (working copy)
> @@ -1,6 +1,7 @@
>  // { dg-do compile }
>  // { dg-require-effective-target c++11 }
>  // { dg-additional-options "-fdump-tree-optimized" }
> +// { dg-additional-options "-fpermissive"  { target newlib } }
> 
>  #include <cstdint>
> 
> @@ -21,7 +22,7 @@
>          BitfieldStructUnion(uint32_t value_low, uint32_t value_high) :
> value_low(value_low), value_high(value_high) {}
>  };
> 
> -volatile uint32_t *WRITE = (volatile unsigned*)0x42;
> +volatile uint32_t *WRITE = (volatile unsigned*)0x42; // { dg-warning "invalid
> conversion" { target newlib } }

Why not just write (volatile uint32_t *)?

OK with just that.

> 
>  void buggy() {
>          for (int i = 0; i < runs; i++) {

Reply via email to