Re: [PATCH] middle-end: Use rtx_equal_p in notice_stack_pointer_modification_1 [PR117359]

2024-11-05 Thread Andreas Schwab
On Nov 05 2024, Uros Bizjak wrote:

> asm volatile ("pushfq; popfq %0" : "=r"(x));
>
> doesn't change SP at any sequence point, doesn't clobber the function
> frame, but the function using it shouldn't create redzone. How to
> communicate this to the compiler?

Saying that SP is changed (when it isn't) certainly isn't the right way.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] middle-end: Use rtx_equal_p in notice_stack_pointer_modification_1 [PR117359]

2024-11-05 Thread Andreas Schwab
On Nov 05 2024, Uros Bizjak wrote:

> But what is the non-deprecated way to communicate the fact that SP
> changes, and possibly clobbers stack in the asm to the compiler?

Since an asm statement is not allowed to change SP there is no need for
that.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] RISC-V: override alignment of function/jump/loop

2024-10-25 Thread Andreas Schwab
../../gcc/config/riscv/riscv.cc:460:1: error: could not convert '{{(4 * 4), (5 \
* 4)}, {(4 * 4), (5 * 4)}, {(20 * 4), (20 * 4)}, {(4 * 4), (4 * 4)}, {(33 * 4),\
 (65 * 4)}, 1, 3, 5, 8, true, false, false, false, RISCV_FUSE_NOTHING, nullptr}\
' from '' to 'const riscv_tune_param'

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


m68k: replace reload_in_progress by reload_in_progress || lra_in_progress

2024-10-13 Thread Andreas Schwab
ress || lra_in_progress))
 {
   if (CONSTANT_P (operands[1]))
{
diff --git a/gcc/config/m68k/predicates.md b/gcc/config/m68k/predicates.md
index 46fc3795a17..787e544a43f 100644
--- a/gcc/config/m68k/predicates.md
+++ b/gcc/config/m68k/predicates.md
@@ -237,6 +237,7 @@ (define_predicate "fp_src_operand"
  || (TARGET_68881
  && (!standard_68881_constant_p (op)
  || reload_in_progress
+ || lra_in_progress
  || reload_completed)));
 })
 
-- 
2.47.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5] gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]

2024-10-08 Thread Andreas Schwab
../../libcpp/directives.cc: In function 'void do_pragma_once(cpp_reader*)':
../../libcpp/directives.cc:2078:20: error: unknown conversion type character 
'<' in format [-Werror=format=]
 2078 |  "%<#pragma once%> in main file");
  |^
../../libcpp/directives.cc:2078:34: error: unknown conversion type character 
'>' in format [-Werror=format=]
 2078 |  "%<#pragma once%> in main file");
  |  ^
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:227: directives.o] Error 1

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] ltmain.sh: allow more flags at link-time

2024-09-26 Thread Andreas Schwab
This has been fixed in commit d31c9cf54ac.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] ltmain.sh: allow more flags at link-time

2024-09-26 Thread Andreas Schwab
On Aug 14 2024, Sam James wrote:

> In particular, this now allows some harmless diagnostic flags (especially
> useful for things like -Werror=odr), more optimization flags, and some
> Clang-specific options.

This now passes -Werror down to the linker, which breaks the binutils
build with LTO because this warning is turned into an error:

In function 'memset',
inlined from 'ecoff_link_hash_newfunc' at ../../bfd/ecoff.c:3282:3:
/usr/include/bits/string_fortified.h:59:10: error: '__builtin_memset' writing 
32 bytes into a region of size 0 overflows the destination 
[-Werror=stringop-overflow=]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
  |  ^
In function 'ecoff_link_hash_newfunc':
lto1: note: destination object is likely at address zero
lto1: all warnings being treated as errors
make[5]: *** [/tmp/ccqDR7oz.mk:48: /tmp/cc9vfAF0.ltrans23.ltrans.o] Error 1

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] doc: Remove @code wrapping of fortran option names [PR116801]

2024-09-23 Thread Andreas Schwab
On Sep 23 2024, Mikael Morin wrote:

> For options where the variable is not a separate argument, I think it's
> preferable to keep the variable.
>
> For example, -ffree-line-length-@var{n} looks better on the index page as
> "-ffree-line-length-n" (with the n having a different formatting), than as
> "-free-line-length-".  It makes it clear that there is a suffix to the
> option.

Whatever you feel like is the right solution, please make it constent
throughout the manual.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [committed] arc: Remove mlra option [PR113954]

2024-09-23 Thread Andreas Schwab
On Sep 23 2024, Claudiu Zissulescu wrote:

> diff --git a/gcc/config/arc/arc.cc b/gcc/config/arc/arc.cc
> index c800226b179..a225adeff57 100644
> --- a/gcc/config/arc/arc.cc
> +++ b/gcc/config/arc/arc.cc
> @@ -721,7 +721,7 @@ static rtx arc_legitimize_address_0 (rtx, rtx, 
> machine_mode mode);
>arc_no_speculation_in_delay_slots_p
>  
>  #undef TARGET_LRA_P
> -#define TARGET_LRA_P arc_lra_p
> +#define TARGET_LRA_P hook_bool_void_true

This is the default for lra_p, so you can remove the override.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] doc: Remove @code wrapping of fortran option names [PR116801]

2024-09-22 Thread Andreas Schwab
On Sep 22 2024, Arsen Arsenović wrote:

> Andreas Schwab  writes:
>
>> On Sep 22 2024, Jakub Jelinek wrote:
>>
>>> On Sun, Sep 22, 2024 at 10:52:37PM +0200, Andreas Schwab wrote:
>>>> On Sep 22 2024, Mikael Morin wrote:
>>>> 
>>>> > @@ -370,7 +370,7 @@ Set the default accessibility of module entities to 
>>>> > @code{PRIVATE}.
>>>> >  Use-associated entities will not be accessible unless they are 
>>>> > explicitly
>>>> >  declared as @code{PUBLIC}.
>>>> >  
>>>> > -@opindex @code{ffixed-line-length-}@var{n}
>>>> > +@opindex ffixed-line-length-@var{n}
>>>> 
>>>> Shouldn't all the @var{...} parts be dropped as well, throughout?
>>>
>>> We have it all over the other manuals:
>>
>> But it causes them to not show up in the urls files.
>
> That seems like a defect of the regen script rather than of the manuals.
> They're there for a reason (signifying that something is not a fixed
> string).

It's only about the @opindex.  The vast majority have those variable
parts removed from the index entry.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] doc: Remove @code wrapping of fortran option names [PR116801]

2024-09-22 Thread Andreas Schwab
On Sep 22 2024, Jakub Jelinek wrote:

> On Sun, Sep 22, 2024 at 10:52:37PM +0200, Andreas Schwab wrote:
>> On Sep 22 2024, Mikael Morin wrote:
>> 
>> > @@ -370,7 +370,7 @@ Set the default accessibility of module entities to 
>> > @code{PRIVATE}.
>> >  Use-associated entities will not be accessible unless they are explicitly
>> >  declared as @code{PUBLIC}.
>> >  
>> > -@opindex @code{ffixed-line-length-}@var{n}
>> > +@opindex ffixed-line-length-@var{n}
>> 
>> Shouldn't all the @var{...} parts be dropped as well, throughout?
>
> We have it all over the other manuals:

But it causes them to not show up in the urls files.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] doc: Remove @code wrapping of fortran option names [PR116801]

2024-09-22 Thread Andreas Schwab
On Sep 22 2024, Mikael Morin wrote:

> @@ -370,7 +370,7 @@ Set the default accessibility of module entities to 
> @code{PRIVATE}.
>  Use-associated entities will not be accessible unless they are explicitly
>  declared as @code{PUBLIC}.
>  
> -@opindex @code{ffixed-line-length-}@var{n}
> +@opindex ffixed-line-length-@var{n}

Shouldn't all the @var{...} parts be dropped as well, throughout?

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] riscv: Fix duplicate assmbler label in @tlsdesc insn

2024-09-16 Thread Andreas Schwab
Use %= instead of maintaining a sequence number manually, so that it
doesn't result in a duplicate assembler label when the insn is duplicated.

PR target/116693
* config/riscv/riscv.cc (riscv_legitimize_tls_address): Don't pass
seqno to gen_tlsdesc and remove it.
* config/riscv/riscv.md (@tlsdesc): Remove operand 1.  Use
%= instead of %1 in template.
---
 gcc/config/riscv/riscv.cc |  4 +---
 gcc/config/riscv/riscv.md | 15 +++
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 6efe14ff199..fbf2da71e10 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -2779,14 +2779,12 @@ riscv_legitimize_tls_address (rtx loc)
 case TLS_MODEL_GLOBAL_DYNAMIC:
   if (TARGET_TLSDESC)
{
- static unsigned seqno;
  tp = gen_rtx_REG (Pmode, THREAD_POINTER_REGNUM);
  a0 = gen_rtx_REG (Pmode, GP_ARG_FIRST);
  dest = gen_reg_rtx (Pmode);
 
- emit_insn (gen_tlsdesc (Pmode, loc, GEN_INT (seqno)));
+ emit_insn (gen_tlsdesc (Pmode, loc));
  emit_insn (gen_add3_insn (dest, a0, tp));
- seqno++;
}
   else
{
diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
index 9f94b5aa023..fd1cbebc435 100644
--- a/gcc/config/riscv/riscv.md
+++ b/gcc/config/riscv/riscv.md
@@ -2327,17 +2327,16 @@
 
 (define_insn "@tlsdesc"
   [(set (reg:P A0_REGNUM)
-   (unspec:P
-   [(match_operand:P 0 "symbolic_operand" "")
-(match_operand:P 1 "const_int_operand")]
-   UNSPEC_TLSDESC))
+   (unspec:P
+   [(match_operand:P 0 "symbolic_operand" "")]
+   UNSPEC_TLSDESC))
(clobber (reg:P T0_REGNUM))]
   "TARGET_TLSDESC"
   {
-return ".LT%1: auipc\ta0,%%tlsdesc_hi(%0)\;"
-   "\tt0,%%tlsdesc_load_lo(.LT%1)(a0)\;"
-   "addi\ta0,a0,%%tlsdesc_add_lo(.LT%1)\;"
-   "jalr\tt0,t0,%%tlsdesc_call(.LT%1)";
+return ".LT%=: auipc\ta0,%%tlsdesc_hi(%0)\;"
+   "\tt0,%%tlsdesc_load_lo(.LT%=)(a0)\;"
+   "addi\ta0,a0,%%tlsdesc_add_lo(.LT%=)\;"
+   "jalr\tt0,t0,%%tlsdesc_call(.LT%=)";
   }
   [(set_attr "type" "multi")
(set_attr "length" "16")
-- 
2.46.1


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] testsuite: Relax line number match in gfortran.dg/pr95690.f90

2024-09-11 Thread Andreas Schwab
The actual line number is target dependent, and immaterial for the test.

* gfortran.dg/pr95690.f90: Allow matching error message anywhere.
---
 gcc/testsuite/gfortran.dg/pr95690.f90 | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/pr95690.f90 
b/gcc/testsuite/gfortran.dg/pr95690.f90
index 1432937438a..4bd19b3dcdd 100644
--- a/gcc/testsuite/gfortran.dg/pr95690.f90
+++ b/gcc/testsuite/gfortran.dg/pr95690.f90
@@ -2,8 +2,10 @@
 module m
 contains
subroutine s
-  print *, (erfc) ! { dg-error "not a floating constant" "" { target 
i?86-*-* x86_64-*-* sparc*-*-* cris-*-* hppa*-*-* } }
-   end ! { dg-error "not a floating constant" "" { target { ! "i?86-*-* 
x86_64-*-* sparc*-*-* cris-*-* hppa*-*-*" } } }
+  print *, (erfc)
+   end
function erfc()
end
 end
+! The actual line number is target dependent, allow any
+! { dg-error "not a floating constant" "" { target *-*-* } 0 }
-- 
2.46.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] libsupc++: Fix handling of m68k extended real in

2024-09-02 Thread Andreas Schwab
PR libstdc++/116513
* libsupc++/compare (_S_fp_bits) [__fmt == _M68k_80bit]: Shift
padding out of exponent word.
---
 libstdc++-v3/libsupc++/compare | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare
index 686aa6d218f..63ad6b5c23e 100644
--- a/libstdc++-v3/libsupc++/compare
+++ b/libstdc++-v3/libsupc++/compare
@@ -838,7 +838,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
  using enum _Fp_fmt;
 #endif
  constexpr auto __fmt = _S_fp_fmt<_Tp>();
- if constexpr (__fmt == _X86_80bit || __fmt == _M68k_80bit)
+ if constexpr (__fmt == _X86_80bit)
{
  if constexpr (sizeof(_Tp) == 3 * sizeof(int32_t))
{
@@ -851,6 +851,11 @@ namespace std _GLIBCXX_VISIBILITY(default)
  return _Int(__ival._M_hi, __ival._M_lo);
}
}
+ else if constexpr (__fmt == _M68k_80bit)
+   {
+ auto __ival = __builtin_bit_cast(_Int, __val);
+ return _Int(__ival._M_hi >> 16, __ival._M_lo);
+   }
  else if constexpr (sizeof(_Tp) == 2 * sizeof(int64_t))
{
 #if __SIZEOF_INT128__
-- 
2.46.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


m68k: Accept ASHIFT like MULT in address operand

2024-08-27 Thread Andreas Schwab
When LRA pulls an address operand out of a MEM it caninoicalizes a
containing MULT into ASHIFT.  Adjust the address decomposer to recognize
this form.

PR target/116413
* config/m68k/m68k.cc (m68k_decompose_index): Accept ASHIFT like
MULT.
(m68k_rtx_costs) [PLUS]: Likewise.
(m68k_legitimize_address): Likewise.
---
 gcc/config/m68k/m68k.cc | 58 -
 1 file changed, 40 insertions(+), 18 deletions(-)

diff --git a/gcc/config/m68k/m68k.cc b/gcc/config/m68k/m68k.cc
index 21c94981d22..7986e92c511 100644
--- a/gcc/config/m68k/m68k.cc
+++ b/gcc/config/m68k/m68k.cc
@@ -1503,12 +1503,14 @@ m68k_legitimize_address (rtx x, rtx oldx, machine_mode 
mode)
 
 #define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = 1; }
 
-  if (GET_CODE (XEXP (x, 0)) == MULT)
+  if (GET_CODE (XEXP (x, 0)) == MULT
+ || GET_CODE (XEXP (x, 0)) == ASHIFT)
{
  COPY_ONCE (x);
  XEXP (x, 0) = force_operand (XEXP (x, 0), 0);
}
-  if (GET_CODE (XEXP (x, 1)) == MULT)
+  if (GET_CODE (XEXP (x, 1)) == MULT
+ || GET_CODE (XEXP (x, 1)) == ASHIFT)
{
  COPY_ONCE (x);
  XEXP (x, 1) = force_operand (XEXP (x, 1), 0);
@@ -2069,16 +2071,29 @@ m68k_decompose_index (rtx x, bool strict_p, struct 
m68k_address *address)
 
   /* Check for a scale factor.  */
   scale = 1;
-  if ((TARGET_68020 || TARGET_COLDFIRE)
-  && GET_CODE (x) == MULT
-  && GET_CODE (XEXP (x, 1)) == CONST_INT
-  && (INTVAL (XEXP (x, 1)) == 2
- || INTVAL (XEXP (x, 1)) == 4
- || (INTVAL (XEXP (x, 1)) == 8
- && (TARGET_COLDFIRE_FPU || !TARGET_COLDFIRE
+  if (TARGET_68020 || TARGET_COLDFIRE)
 {
-  scale = INTVAL (XEXP (x, 1));
-  x = XEXP (x, 0);
+  if (GET_CODE (x) == MULT
+ && GET_CODE (XEXP (x, 1)) == CONST_INT
+ && (INTVAL (XEXP (x, 1)) == 2
+ || INTVAL (XEXP (x, 1)) == 4
+ || (INTVAL (XEXP (x, 1)) == 8
+ && (TARGET_COLDFIRE_FPU || !TARGET_COLDFIRE
+   {
+ scale = INTVAL (XEXP (x, 1));
+ x = XEXP (x, 0);
+   }
+  /* LRA uses ASHIFT instead of MULT outside of MEM.  */
+  else if (GET_CODE (x) == ASHIFT
+  && GET_CODE (XEXP (x, 1)) == CONST_INT
+  && (INTVAL (XEXP (x, 1)) == 1
+  || INTVAL (XEXP (x, 1)) == 2
+  || (INTVAL (XEXP (x, 1)) == 3
+  && (TARGET_COLDFIRE_FPU || !TARGET_COLDFIRE
+   {
+ scale = 1 << INTVAL (XEXP (x, 1));
+ x = XEXP (x, 0);
+   }
 }
 
   /* Check for a word extension.  */
@@ -2246,8 +2261,10 @@ m68k_decompose_address (machine_mode mode, rtx x,
  ??? do_tablejump creates these addresses before placing the target
  label, so we have to assume that unplaced labels are jump table
  references.  It seems unlikely that we would ever generate indexed
- accesses to unplaced labels in other cases.  */
+ accesses to unplaced labels in other cases.  Do not accept it in
+ PIC mode, since the label address will need to be loaded from memory.  */
   if (GET_CODE (x) == PLUS
+  && !flag_pic
   && m68k_jump_table_ref_p (XEXP (x, 1))
   && m68k_decompose_index (XEXP (x, 0), strict_p, address))
 {
@@ -3068,12 +3085,17 @@ m68k_rtx_costs (rtx x, machine_mode mode, int 
outer_code,
   /* An lea costs about three times as much as a simple add.  */
   if (mode == SImode
  && GET_CODE (XEXP (x, 1)) == REG
- && GET_CODE (XEXP (x, 0)) == MULT
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
- && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
- && (INTVAL (XEXP (XEXP (x, 0), 1)) == 2
- || INTVAL (XEXP (XEXP (x, 0), 1)) == 4
- || INTVAL (XEXP (XEXP (x, 0), 1)) == 8))
+ && ((GET_CODE (XEXP (x, 0)) == MULT
+  && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
+  && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
+  && (INTVAL (XEXP (XEXP (x, 0), 1)) == 2
+  || INTVAL (XEXP (XEXP (x, 0), 1)) == 4
+  || INTVAL (XEXP (XEXP (x, 0), 1)) == 8))
+ || (GET_CODE (XEXP (x, 0)) == ASHIFT
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
+ && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (x, 0), 1))
+ <= 3
{
/* lea an@(dx:l:i),am */
*total = COSTS_N_INSNS (TARGET_COLDFIRE ? 2 : 3);
-- 
2.46.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v4] Extend check-function-bodies to allow label and directives

2024-08-27 Thread Andreas Schwab
On Aug 27 2024, H.J. Lu wrote:

> diff --git a/gcc/testsuite/gcc.target/i386/pr116174.c 
> b/gcc/testsuite/gcc.target/i386/pr116174.c
> index 8877d0b51af..686aeb9ff31 100644
> --- a/gcc/testsuite/gcc.target/i386/pr116174.c
> +++ b/gcc/testsuite/gcc.target/i386/pr116174.c
> @@ -1,6 +1,20 @@
>  /* { dg-do compile { target *-*-linux* } } */
> -/* { dg-options "-O2 -fcf-protection=branch" } */
> +/* { dg-options "-O2 -g0 -fcf-protection=branch" } */
> +/* Keep labels and directives ('.p2align', '.cfi_startproc').
> +/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} 
>  } } */

This has a "nested" comment (line 3 missing coment end).

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: LRA: Fix setup_sp_offset

2024-08-25 Thread Andreas Schwab
On Aug 25 2024, H.J. Lu wrote:

> Is it because i386 pushes the return address on stack?

Like m68k.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


m68k: Add -mlra

2024-08-19 Thread Andreas Schwab
PR target/113939
* config/m68k/m68k.opt (mlra): New target option.
* config/m68k/m68k.cc (m68k_use_lra_p): New function.
(TARGET_LRA_P): Use it.
* config/m68k/m68k.opt.urls: Regenerate.
---
 gcc/config/m68k/m68k.cc   | 11 ++-
 gcc/config/m68k/m68k.opt  |  5 +
 gcc/config/m68k/m68k.opt.urls |  2 ++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/gcc/config/m68k/m68k.cc b/gcc/config/m68k/m68k.cc
index 22fdc723592..0e4e58a4da6 100644
--- a/gcc/config/m68k/m68k.cc
+++ b/gcc/config/m68k/m68k.cc
@@ -199,6 +199,7 @@ static machine_mode m68k_promote_function_mode (const_tree, 
machine_mode,
 static void m68k_asm_final_postscan_insn (FILE *, rtx_insn *insn, rtx [], int);
 static HARD_REG_SET m68k_zero_call_used_regs (HARD_REG_SET);
 static machine_mode m68k_c_mode_for_floating_type (enum tree_index);
+static bool m68k_use_lra_p (void);
 
 /* Initialize the GCC target structure.  */
 
@@ -307,7 +308,7 @@ static machine_mode m68k_c_mode_for_floating_type (enum 
tree_index);
 #endif
 
 #undef TARGET_LRA_P
-#define TARGET_LRA_P hook_bool_void_false
+#define TARGET_LRA_P m68k_use_lra_p
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_Pm68k_legitimate_address_p
@@ -7248,4 +7249,12 @@ m68k_c_mode_for_floating_type (enum tree_index ti)
   return default_mode_for_floating_type (ti);
 }
 
+/* Implement TARGET_LRA_P.  */
+
+static bool
+m68k_use_lra_p ()
+{
+  return m68k_lra_p;
+}
+
 #include "gt-m68k.h"
diff --git a/gcc/config/m68k/m68k.opt b/gcc/config/m68k/m68k.opt
index b2ab41a758f..1b393f54e3c 100644
--- a/gcc/config/m68k/m68k.opt
+++ b/gcc/config/m68k/m68k.opt
@@ -146,6 +146,11 @@ mlong-jump-table-offsets
 Target RejectNegative Mask(LONG_JUMP_TABLE_OFFSETS)
 Use 32-bit offsets in jump tables rather than 16-bit offsets.
 
+mlra
+Target Var(m68k_lra_p) Undocumented
+Usa LRA for reload instead of the old reload framework.  This option is
+experimental, and it may be removed in future versions of the compiler.
+
 mnobitfield
 Target RejectNegative InverseMask(BITFIELD)
 Do not use the bit-field instructions.
diff --git a/gcc/config/m68k/m68k.opt.urls b/gcc/config/m68k/m68k.opt.urls
index 079fbf4a88e..1f1ac88bcb2 100644
--- a/gcc/config/m68k/m68k.opt.urls
+++ b/gcc/config/m68k/m68k.opt.urls
@@ -77,6 +77,8 @@ UrlSuffix(gcc/M680x0-Options.html#index-mhard-float-2)
 mlong-jump-table-offsets
 UrlSuffix(gcc/M680x0-Options.html#index-mlong-jump-table-offsets)
 
+; skipping UrlSuffix for 'mlra' due to finding no URLs
+
 mnobitfield
 UrlSuffix(gcc/M680x0-Options.html#index-mnobitfield)
 
-- 
2.46.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Tweak base/index disambiguation in decompose_normal_address [PR116236]

2024-08-15 Thread Andreas Schwab
On Aug 15 2024, Jeff Law wrote:

> On 8/15/24 2:50 AM, Richard Sandiford wrote:
>> The PR points out that, for an address like:
>>(plus (zero_extend X) Y)
>> decompose_normal_address doesn't establish a strong preference
>> between treating X as the base or Y as the base.  As the comment
>> in the patch says, zero_extend isn't enough on its own to assume
>> an index, at least not on POINTERS_EXTEND_UNSIGNED targets.
>> But in a construct like the one above, X and Y have different modes,
>> and it seems reasonable to assume that the one with the expected
>> address mode is the base.
>> This matters on targets like m68k that support index extension
>> and that require different classes for bases and indices.
>> Tested on aarch64-linux-gnu & x86_64-linux-gnu.  Andreas also confirms
>> that it fixes the m68k LRA problem.  OK to install?
>> Richard
>> gcc/
>>  PR middle-end/116236
>>  * rtlanal.cc (decompose_normal_address): Try to distinguish
>>  bases and indices based on mode, before resorting to "baseness".
> OK.  Thanks to everyone for chasing this down.  No idea where we sit with
> the conversion of m68k to LRA but this looks like it'd be helpful
> irrespective of that effort.

With PR116236 and PR116374 the situation is looking quite well.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: Fwd: [PATCH] Don't force-enable ifuncs on RISC-V

2024-07-18 Thread Andreas Schwab
On Jul 18 2024, Maxim Blinov wrote:

> +if test $default_gnu_indirect_function = yes; then
> +  case "${target}" in
> +riscv*-*-linux*)
> +  AC_MSG_CHECKING(linker ifunc IRELATIVE support)
> +  cat > conftest.s < +  .text
> +  .typefoo_resolver, @function
> +  foo_resolver:
> +  ret
> +  .sizefoo_resolver, .-foo_resolver
> +
> +  .globlfoo
> +  .typefoo, %gnu_indirect_function
> +  .setfoo, foo_resolver
> +
> +  .globlbar
> +  .typebar, @function
> +  bar:
> +  callfoo
> +  ret
> +  .sizebar, .-bar
> +  EOF
> +  if test x$gcc_cv_as != x \
> + && test x$gcc_cv_ld != x \
> + && test x$gcc_cv_readelf != x \
> + && $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
> + && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1 \
> + && $gcc_cv_readelf --relocs --wide conftest \
> +| grep R_RISCV_IRELATIVE > /dev/null 2>&1; then
> +enable_gnu_indirect_function=yes
> +  else
> +enable_gnu_indirect_function=no
> +  fi
> +  rm -f conftest conftest.o conftest.s
> +  AC_MSG_RESULT($enable_gnu_indirect_function)
> +  ;;
> +  esac
> +fi

That should actually set default_gnu_indirect_function instead of
enable_gnu_indirect_function, and moved before the check for the
--enable-gnu-indirect-function option.  Otherwise
--disable-gnu-indirect-function still won't work as expected.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [committed][PR rtl-optimization/115876][PR rtl-optimization/115916] Fix sign/carry bit handling in ext-dce

2024-07-16 Thread Andreas Schwab
On Jul 15 2024, Jeff Law wrote:

> My change to fix a ubsan issue broke handling propagation of the
> carry/sign bit down through a right shift.

What about the other ASHIFTs?

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [r15-2011 Regression] FAIL: gcc.target/i386/pr31985.c scan-assembler-times movl 4 on Linux/x86_64

2024-07-15 Thread Andreas Schwab
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115876#c7

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] [libstdc++] [testsuite] xfail 128bit from_chars on all aarch64-*-*

2024-07-11 Thread Andreas Schwab
On Jul 11 2024, Jonathan Wakely wrote:

> On Thu, 11 Jul 2024 at 14:21, Alexandre Oliva  wrote:
>>
>>
>> Having observed failures of these two tests on yet another aarch64
>> operating system, and having concluded that the conditions that
>> trigger the problem ought to be present on all aarch64 targets, I'm
>> now matching any aarch64 target_os to enable the workaround.
>
> That's concerning, aarch64-unknown-linux-gnu with glibc should work OK
> for float128_t, because aarch64 already has 128-bit long double, so
> there's no good reason that float128_t wouldn't work. What are the
> conditions that trigger the problem?

Both tests run sucessfully on aarch64-linux.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [gcc r15-1619] ira: Scale save/restore costs of callee save registers with block frequency

2024-06-27 Thread Andreas Schwab
This breaks s390.

../../../../../gcc/libstdc++-v3/src/c++17/floating_to_chars.cc: In function 
‘std::to_chars_result std::__floating_to_chars_shortest(char*, char*, T, 
chars_format) [with T = long double]’:
../../../../../gcc/libstdc++-v3/src/c++17/floating_to_chars.cc:1306:3: internal 
compiler error: in print_addrstyle_operand, at config/s390/s390.cc:8143
 1306 |   }
  |   ^
0x1591681 print_addrstyle_operand
../../gcc/gcc/config/s390/s390.cc:8143
0x1591681 print_shift_count_operand
../../gcc/gcc/config/s390/s390.cc:8170
0x1591681 print_operand(_IO_FILE*, rtx_def*, int)
../../gcc/gcc/config/s390/s390.cc:8637
0xcd9d10 output_operand(rtx_def*, int)
../../gcc/gcc/final.cc:3631
0xcda79d output_asm_insn(char const*, rtx_def**)
../../gcc/gcc/final.cc:3524
0xcdc52e output_asm_insn(char const*, rtx_def**)
../../gcc/gcc/final.cc:2752
0xcdc52e final_scan_insn_1
../../gcc/gcc/final.cc:2840
0xcdcbbb final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc/gcc/final.cc:2886
0xcdccd1 final_1
../../gcc/gcc/final.cc:1977
0xcdda52 rest_of_handle_final
../../gcc/gcc/final.cc:4239
0xcdda52 execute
../../gcc/gcc/final.cc:4317

Also seen when compiling glibc.

during RTL pass: final
dl-lookup.c: In function 'check_match':
dl-lookup.c:162:1: internal compiler error: in print_addrstyle_operand, at 
config/s390/s390.cc:8143
  162 | }
  | ^

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] Fortran: fix passing of optional dummy as actual to optional argument [PR55978]

2024-06-24 Thread Andreas Schwab
On Jun 24 2024, Mikael Morin wrote:

> tree-pretty-print.cc's op_symbol_code handles them as:
>
> case TRUTH_AND_EXPR:
> case TRUTH_ANDIF_EXPR:
>   return "&&";
>
> so no, I don't think they are differentiated.

Only because C does not have a TRUTH_AND_EXPR operator.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [RFC v2] RISC-V: Promote Zaamo/Zalrsc to a when using an old binutils

2024-06-15 Thread Andreas Schwab
../../gcc/common/config/riscv/riscv-common.cc: In member function 'std::string 
riscv_subset_list::to_string(bool, bool) const':
../../gcc/common/config/riscv/riscv-common.cc:997:37: error: 'a_subset' may be 
used uninitialized [-Werror=maybe-uninitialized]
  997 |   if (subset_cmp (a_subset->name, subset->name) > 0)
  |   ~~^~~~
../../gcc/common/config/riscv/riscv-common.cc:923:19: note: 'a_subset' was 
declared here
  923 |   riscv_subset_t *a_subset;
  |   ^~~~
cc1plus: all warnings being treated as errors

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [Committed] RISC-V: Add basic Zaamo and Zalrsc support

2024-06-12 Thread Andreas Schwab
On Jun 12 2024, Li, Pan2 wrote:

> Do we need to upgrade the binutils of the riscv-gnu-toolchain repo? Or we may 
> have unknown prefixed ISA extension `zaamo' when building.

There needs to be a configure check if binutils can grok the extension.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] jit: Ensure ssize_t is defined.

2024-06-11 Thread Andreas Schwab
On Jun 11 2024, Iain Sandoe wrote:

> well, afaict, all the code is c++ and we are building with a std >= 11, so 
> that
> presumes c99 support.

The C standard does not define ssize_t at all, it is only part of POSIX.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] jit: Ensure ssize_t is defined.

2024-06-11 Thread Andreas Schwab
On Jun 11 2024, Richard Biener wrote:

>> Don't you also need to add
>> 
>> approrpiate #define _POSIX_C_SOURCE or #define _XOPE_SOURCE befor the
>> include in case somebody builds with -std=c99?

Such feature macros can only be defined before the very first include of
a system header.

> Oh, and the manpage says that  also defines ssize_t which
> is a bit odd since we already include that ...

Only since POSIX.1-2008.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [to-be-committed] [RISC-V] Use Zbkb for general 64 bit constants when profitable

2024-06-07 Thread Andreas Schwab
In file included from ../../gcc/rtl.h:3973,
 from ../../gcc/config/riscv/riscv.cc:31:
In function 'rtx_def* init_rtx_fmt_ee(rtx, machine_mode, rtx, rtx)',
inlined from 'rtx_def* gen_rtx_fmt_ee_stat(rtx_code, machine_mode, rtx, 
rtx)' at ./genrtl.h:50:26,
inlined from 'void riscv_move_integer(rtx, rtx, long int, machine_mode)' at 
../../gcc/config/riscv/riscv.cc:2786:10:
./genrtl.h:37:16: error: 'x' may be used uninitialized 
[-Werror=maybe-uninitialized]
   37 |   XEXP (rt, 0) = arg0;
../../gcc/config/riscv/riscv.cc: In function 'void riscv_move_integer(rtx, rtx, 
long int, machine_mode)':
../../gcc/config/riscv/riscv.cc:2723:7: note: 'x' was declared here
 2723 |   rtx x;
  |   ^
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2563: riscv.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [NOT CODE REVIEW] [PATCH v3 1/1] [RISC-V] Add support for _Bfloat16

2024-05-14 Thread Andreas Schwab
This breaks libstdc++-abi/abi_check.

3 incompatible symbols 
0
_ZTIPKDF16b
typeinfo for std::bfloat16_t const*
version status: incompatible
CXXABI_1.3.14
type: object
type size: 32
status: added


1
_ZTIPDF16b
typeinfo for std::bfloat16_t*
version status: incompatible
CXXABI_1.3.14
type: object
type size: 32
status: added


2
_ZTIDF16b
typeinfo for std::bfloat16_t
version status: incompatible
CXXABI_1.3.14
type: object
type size: 16
status: added

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [COMMITTED] Enable prange support.

2024-05-09 Thread Andreas Schwab
Breaks bootstrap on aarch64.

$ /opt/gcc/gcc-20240509/Build/./prev-gcc/xg++ 
-B/opt/gcc/gcc-20240509/Build/./prev-gcc/ -B/usr/aarch64-suse-linux/bin/ 
-nostdinc++ 
-B/opt/gcc/gcc-20240509/Build/prev-aarch64-suse-linux/libstdc++-v3/src/.libs 
-B/opt/gcc/gcc-20240509/Build/prev-aarch64-suse-linux/libstdc++-v3/libsupc++/.libs
  
-I/opt/gcc/gcc-20240509/Build/prev-aarch64-suse-linux/libstdc++-v3/include/aarch64-suse-linux
  -I/opt/gcc/gcc-20240509/Build/prev-aarch64-suse-linux/libstdc++-v3/include  
-I/opt/gcc/gcc-20240509/libstdc++-v3/libsupc++ 
-L/opt/gcc/gcc-20240509/Build/prev-aarch64-suse-linux/libstdc++-v3/src/.libs 
-L/opt/gcc/gcc-20240509/Build/prev-aarch64-suse-linux/libstdc++-v3/libsupc++/.libs
  -fno-PIE -c   -g -O2 -fno-checking -gtoggle -DIN_GCC-fno-exceptions 
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings 
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported 
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros 
-Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -fno-PIE -I. -I. 
-I../../gcc -I../../gcc/. -I../../gcc/../include  -I../../gcc/../libcpp/include 
-I../../gcc/../libcody  -I../../gcc/../libdecnumber 
-I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   
-o tree-vect-stmts.o -MT tree-vect-stmts.o -MMD -MP -MF 
./.deps/tree-vect-stmts.TPo ../../gcc/tree-vect-stmts.cc
DISCRIMINATOR FAIL.  Dispatch > RO_PPP <
during IPA pass: inline
../../gcc/tree-vect-stmts.cc:14792:1: internal compiler error: in 
discriminator_fail, at range-op.cc:204
14792 | }
  | ^
0x1145513 range_op_handler::discriminator_fail(vrange const&, vrange const&, 
vrange const&) const
../../gcc/range-op.cc:204
0x114592b range_op_handler::fold_range(vrange&, tree_node*, vrange const&, 
vrange const&, relation_trio) const
../../gcc/range-op.cc:228
0x1fe978b ipa_value_range_from_jfunc(vrange&, ipa_node_params*, cgraph_edge*, 
ipa_jump_func*, tree_node*)
../../gcc/ipa-cp.cc:1743
0xf5e0d7 evaluate_properties_for_edge(cgraph_edge*, bool, unsigned int*, 
unsigned int*, ipa_auto_call_arg_values*, bool)
../../gcc/ipa-fnsummary.cc:680
0xf6fedf do_estimate_edge_size(cgraph_edge*)
../../gcc/ipa-inline-analysis.cc:337
0xf72acf estimate_edge_size(cgraph_edge*)
../../gcc/ipa-inline.h:79
0xf72acf estimate_edge_growth(cgraph_edge*)
../../gcc/ipa-inline.h:100
0xf713cf do_estimate_growth_1
../../gcc/ipa-inline-analysis.cc:436
0xf714ff cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*, 
void*), void*, bool)
../../gcc/cgraph.h:3429
0xf714ff estimate_growth(cgraph_node*)
../../gcc/ipa-inline-analysis.cc:474
0x200d153 inline_small_functions
../../gcc/ipa-inline.cc:2081
0x200d153 ipa_inline
../../gcc/ipa-inline.cc:2850
0x200d153 execute
../../gcc/ipa-inline.cc:3248

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH][risc-v] libstdc++: Preserve signbit of nan when converting float to double [PR113578]

2024-05-07 Thread Andreas Schwab
On Mai 07 2024, Jonathan Wakely wrote:

> +#ifdef __riscv
> + return _M_insert(__builtin_copysign((double)__f,
> + (double)-__builtin_signbit(__f));

Should this use static_cast?

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] libstdc++: Update powerpc-linux-gnu baseline_symbols

2024-05-03 Thread Andreas Schwab
:_ZSt21__to_chars_bfloat16_tPcS_fSt12chars_format@@GLIBCXX_3.4.31
+FUNC:_ZSt21ios_base_library_initv@@GLIBCXX_3.4.32
+FUNC:_ZSt22__from_chars_float16_tPKcS0_RfSt12chars_format@@GLIBCXX_3.4.31
 FUNC:_ZSt22__throw_overflow_errorPKc@@GLIBCXX_3.4
+FUNC:_ZSt23__from_chars_bfloat16_tPKcS0_RfSt12chars_format@@GLIBCXX_3.4.31
 FUNC:_ZSt23__throw_underflow_errorPKc@@GLIBCXX_3.4
 FUNC:_ZSt24__throw_invalid_argumentPKc@@GLIBCXX_3.4
 FUNC:_ZSt24__throw_out_of_range_fmtPKcz@@GLIBCXX_3.4.20
@@ -4671,6 +4753,7 @@ FUNC:__cxa_allocate_exception@@CXXABI_1.3
 FUNC:__cxa_bad_cast@@CXXABI_1.3
 FUNC:__cxa_bad_typeid@@CXXABI_1.3
 FUNC:__cxa_begin_catch@@CXXABI_1.3
+FUNC:__cxa_call_terminate@@CXXABI_1.3.15
 FUNC:__cxa_call_unexpected@@CXXABI_1.3
 FUNC:__cxa_current_exception_type@@CXXABI_1.3
 FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
@@ -4735,6 +4818,8 @@ OBJECT:0:CXXABI_1.3.10
 OBJECT:0:CXXABI_1.3.11
 OBJECT:0:CXXABI_1.3.12
 OBJECT:0:CXXABI_1.3.13
+OBJECT:0:CXXABI_1.3.14
+OBJECT:0:CXXABI_1.3.15
 OBJECT:0:CXXABI_1.3.2
 OBJECT:0:CXXABI_1.3.3
 OBJECT:0:CXXABI_1.3.4
@@ -4770,6 +4855,9 @@ OBJECT:0:GLIBCXX_3.4.28
 OBJECT:0:GLIBCXX_3.4.29
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.30
+OBJECT:0:GLIBCXX_3.4.31
+OBJECT:0:GLIBCXX_3.4.32
+OBJECT:0:GLIBCXX_3.4.33
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
 OBJECT:0:GLIBCXX_3.4.6
@@ -4780,6 +4868,7 @@ OBJECT:0:GLIBCXX_LDBL_3.4
 OBJECT:0:GLIBCXX_LDBL_3.4.10
 OBJECT:0:GLIBCXX_LDBL_3.4.21
 OBJECT:0:GLIBCXX_LDBL_3.4.29
+OBJECT:0:GLIBCXX_LDBL_3.4.31
 OBJECT:0:GLIBCXX_LDBL_3.4.7
 OBJECT:1028:_ZNSt3tr18__detail12__prime_listE@@GLIBCXX_3.4.10
 OBJECT:1028:_ZNSt8__detail12__prime_listE@@GLIBCXX_3.4.10
@@ -4965,6 +5054,9 @@ OBJECT:15:_ZTSSt8numpunctIcE@@GLIBCXX_3.4
 OBJECT:15:_ZTSSt8numpunctIwE@@GLIBCXX_3.4
 
OBJECT:16:_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4
 OBJECT:16:_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4
+OBJECT:16:_ZTIPDF32_@@CXXABI_1.3.14
+OBJECT:16:_ZTIPDF32x@@CXXABI_1.3.14
+OBJECT:16:_ZTIPDF64_@@CXXABI_1.3.14
 OBJECT:16:_ZTIPDd@@CXXABI_1.3.4
 OBJECT:16:_ZTIPDe@@CXXABI_1.3.4
 OBJECT:16:_ZTIPDf@@CXXABI_1.3.4
@@ -4972,6 +5064,9 @@ OBJECT:16:_ZTIPDi@@CXXABI_1.3.3
 OBJECT:16:_ZTIPDn@@CXXABI_1.3.5
 OBJECT:16:_ZTIPDs@@CXXABI_1.3.3
 OBJECT:16:_ZTIPDu@@CXXABI_1.3.12
+OBJECT:16:_ZTIPKDF32_@@CXXABI_1.3.14
+OBJECT:16:_ZTIPKDF32x@@CXXABI_1.3.14
+OBJECT:16:_ZTIPKDF64_@@CXXABI_1.3.14
 OBJECT:16:_ZTIPKDd@@CXXABI_1.3.4
 OBJECT:16:_ZTIPKDe@@CXXABI_1.3.4
 OBJECT:16:_ZTIPKDf@@CXXABI_1.3.4
@@ -6174,6 +6269,9 @@ 
OBJECT:8:_ZGVNSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE@@G
 
OBJECT:8:_ZGVNSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE2idE@@GLIBCXX_3.4
 
OBJECT:8:_ZGVNSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE@@GLIBCXX_3.4
 
OBJECT:8:_ZGVNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2idE@@GLIBCXX_3.4
+OBJECT:8:_ZTIDF32_@@CXXABI_1.3.14
+OBJECT:8:_ZTIDF32x@@CXXABI_1.3.14
+OBJECT:8:_ZTIDF64_@@CXXABI_1.3.14
 OBJECT:8:_ZTIDd@@CXXABI_1.3.4
 OBJECT:8:_ZTIDe@@CXXABI_1.3.4
 OBJECT:8:_ZTIDf@@CXXABI_1.3.4
-- 
2.45.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] libstdc++: Update baseline symbols for riscv64-linux

2024-04-15 Thread Andreas Schwab


* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.
---
 .../config/abi/post/riscv64-linux-gnu/baseline_symbols.txt| 4 
 1 file changed, 4 insertions(+)

diff --git 
a/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt 
b/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
index 9423cfb8efc..9229ad33458 100644
--- a/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
@@ -499,6 +499,10 @@ FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
 FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.33
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
 FUNC:_ZNKSt12bad_weak_ptr4whatEv@@GLIBCXX_3.4.15
 FUNC:_ZNKSt12future_error4whatEv@@GLIBCXX_3.4.14
 FUNC:_ZNKSt12strstreambuf6pcountEv@@GLIBCXX_3.4
-- 
2.44.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] libstdc++: Regenerate trunk baseline_symbols.txt files for Linux

2024-04-11 Thread Andreas Schwab
On Apr 11 2024, Jakub Jelinek wrote:

> On Thu, Apr 11, 2024 at 04:35:52PM +0200, Andreas Schwab wrote:
>> +FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
>> +FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
>> +FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
>> +FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
>
> If there are other changes needed for m68k, it means it wasn't regenerated
> properly before the 13.1 release a year ago.

Why do you think this has anything to do with m68k?

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] libstdc++: Regenerate trunk baseline_symbols.txt files for Linux

2024-04-11 Thread Andreas Schwab
On Apr 11 2024, Jakub Jelinek wrote:

> --- libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt.jj
> 2024-04-11 15:55:49.982325397 +0200
> +++ libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt   
> 2024-04-11 16:10:05.206559463 +0200
> @@ -497,6 +497,7 @@ FUNC:_ZNKSt11__timepunctIwE7_M_daysEPPKw
>  FUNC:_ZNKSt11__timepunctIwE8_M_am_pmEPPKw@@GLIBCXX_3.4
>  FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
>  FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
> +FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.33
>  FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
>  FUNC:_ZNKSt12bad_weak_ptr4whatEv@@GLIBCXX_3.4.15
>  FUNC:_ZNKSt12future_error4whatEv@@GLIBCXX_3.4.14
> @@ -4525,6 +4526,7 @@ FUNC:__cxa_allocate_exception@@CXXABI_1.
>  FUNC:__cxa_bad_cast@@CXXABI_1.3
>  FUNC:__cxa_bad_typeid@@CXXABI_1.3
>  FUNC:__cxa_begin_catch@@CXXABI_1.3
> +FUNC:__cxa_call_terminate@@CXXABI_1.3.15
>  FUNC:__cxa_call_unexpected@@CXXABI_1.3
>  FUNC:__cxa_current_exception_type@@CXXABI_1.3
>  FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
> @@ -4568,6 +4570,7 @@ OBJECT:0:CXXABI_1.3.11
>  OBJECT:0:CXXABI_1.3.12
>  OBJECT:0:CXXABI_1.3.13
>  OBJECT:0:CXXABI_1.3.14
> +OBJECT:0:CXXABI_1.3.15
>  OBJECT:0:CXXABI_1.3.2
>  OBJECT:0:CXXABI_1.3.3
>  OBJECT:0:CXXABI_1.3.4
> @@ -4604,6 +4607,7 @@ OBJECT:0:GLIBCXX_3.4.3
>  OBJECT:0:GLIBCXX_3.4.30
>  OBJECT:0:GLIBCXX_3.4.31
>  OBJECT:0:GLIBCXX_3.4.32
> +OBJECT:0:GLIBCXX_3.4.33
>  OBJECT:0:GLIBCXX_3.4.4
>  OBJECT:0:GLIBCXX_3.4.5
>  OBJECT:0:GLIBCXX_3.4.6

+FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] libstdc++: Regenerate baseline_symbols.txt files for Linux

2024-04-11 Thread Andreas Schwab
XXABI_1.3
 FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
@@ -4566,6 +4574,7 @@ OBJECT:0:CXXABI_1.3.11
 OBJECT:0:CXXABI_1.3.12
 OBJECT:0:CXXABI_1.3.13
 OBJECT:0:CXXABI_1.3.14
+OBJECT:0:CXXABI_1.3.15
 OBJECT:0:CXXABI_1.3.2
 OBJECT:0:CXXABI_1.3.3
 OBJECT:0:CXXABI_1.3.4
-- 
2.44.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] Regenerate opt.urls

2024-04-10 Thread Andreas Schwab
On Apr 09 2024, Palmer Dabbelt wrote:

> I didn't actually regenerate this as I can't figure out how,

make regenerate-opt-urls

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v2] RISC-V: Bugfix ICE for __attribute__((target("arch=+v"))

2024-03-30 Thread Andreas Schwab
../../gcc/common/config/riscv/riscv-common.cc: In static member function 
'static riscv_subset_list* riscv_subset_list::parse(const char*, location_t)':
../../gcc/common/config/riscv/riscv-common.cc:1501:19: error: unused variable 
'itr' [-Werror=unused-variable]
 1501 |   riscv_subset_t *itr;
  |   ^~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2563: riscv-common.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v1] RISC-V: Allow RVV intrinsic when function target("arch=+v")

2024-03-29 Thread Andreas Schwab
../../gcc/config/riscv/riscv-vector-builtins.cc: In function 'rtx_def* 
riscv_vector::expand_builtin(unsigned int, tree, rtx)':
../../gcc/config/riscv/riscv-vector-builtins.cc:4592:16: error: misspelled term 
'builtin function' in format; use 'built-in function' instead 
[-Werror=format-diag]
 4592 |   "builtin function %qE requires the V ISA extension", exp);
  |^~~~
cc1plus: all warnings being treated as errors
make[3]: *** [../../gcc/config/riscv/t-riscv:28: riscv-vector-builtins.o] Error 
1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] aarch64: Add +lse128 architectural extension command-line flag

2024-03-26 Thread Andreas Schwab
On Mär 15 2024, Victor Do Nascimento wrote:

> \ No newline at end of file

Please fix that.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] s390: Fix TARGET_SECONDARY_RELOAD for non-SYMBOL_REFs

2024-02-29 Thread Andreas Schwab
On Feb 29 2024, Stefan Schulze Frielinghaus wrote:

> RTX X must not necessarily be a SYMBOL_REF and may e.g. be an

False friend: s/must not/need not/

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] Skip gnat.dg/div_zero.adb on RISC-V

2024-02-14 Thread Andreas Schwab
Like AArch64 and POWER, RISC-V does not support trap on zero divide.

gcc/testsuite/
* gnat.dg/div_zero.adb: Skip on RISC-V.
---
 gcc/testsuite/gnat.dg/div_zero.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gnat.dg/div_zero.adb 
b/gcc/testsuite/gnat.dg/div_zero.adb
index dedf3928db7..fb1c98caeff 100644
--- a/gcc/testsuite/gnat.dg/div_zero.adb
+++ b/gcc/testsuite/gnat.dg/div_zero.adb
@@ -1,5 +1,5 @@
 -- { dg-do run }
--- { dg-skip-if "divide does not trap" { aarch64*-*-* powerpc*-*-* } }
+-- { dg-skip-if "divide does not trap" { aarch64*-*-* powerpc*-*-* riscv*-*-* 
} }
 
 -- This test requires architecture- and OS-specific support code for unwinding
 -- through signal frames (typically located in *-unwind.h) to pass.  Feel free
-- 
2.43.1


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v1] RISC-V: Bugfix for RVV overloaded intrinisc ICE when empty args

2024-02-10 Thread Andreas Schwab
WTF?

../../gcc/config/riscv/riscv-vector-builtins.cc: In function 'tree_node* 
riscv_vector::resolve_overloaded_builtin(location_t, unsigned int, tree, 
vec*)':
../../gcc/config/riscv/riscv-vector-builtins.cc:4633:65: error: misspelled term 
'args' in format; use 'arguments' instead [-Werror=format-diag]
 4633 | error_at (loc, "no matching function call to %qE with empty args", 
fndecl);
  |         ^~~

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] RISC-V: THEAD: Fix improper immediate value for MODIFY_DISP instruction on 32-bit systems.

2024-02-05 Thread Andreas Schwab
On Feb 05 2024, Jeff Law wrote:

> We're all aware you *can* do that.  But it's never been a requirement to
> commit a patch.

It has always been a requirement that a patch does not break bootstrap.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] RISC-V: THEAD: Fix improper immediate value for MODIFY_DISP instruction on 32-bit systems.

2024-02-05 Thread Andreas Schwab
On Feb 05 2024, Jeff Law wrote:

> Until such systems are common, these niggling issues are bound to show up.

It won't if you do it properly: build with a cross compiler that was
built from the same source and enable -Werror.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] RISC-V: THEAD: Fix improper immediate value for MODIFY_DISP instruction on 32-bit systems.

2024-02-03 Thread Andreas Schwab
On Jan 30 2024, Christoph Müllner wrote:

> retested

Nope.

../../gcc/config/riscv/thead.cc:1144:22: error: invalid suffix on literal; 
C++11 requires a space between literal and string macro [-Werror=literal-suffix]
 1144 |   fprintf (file, "(%s),"HOST_WIDE_INT_PRINT_DEC",%u", 
reg_names[REGNO (addr.reg)],
  |  ^
cc1plus: all warnings being treated as errors
make[3]: *** [../../gcc/config/riscv/t-riscv:127: thead.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/2] libstdc++: Replace padding bits with a bit-field in __format::_Spec

2024-02-01 Thread Andreas Schwab
On Feb 01 2024, Jonathan Wakely wrote:

> This will result in an ABI change for targets that use 1-byte alignment
> for all integral types, e.g. cris-elf.

Or 2-byte alignment as on m68k.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [Committed] RISC-V: Suppress warning

2024-01-21 Thread Andreas Schwab
On Jan 21 2024, Jeff Law wrote:

> Yea.  The biggest problem with ATTRIBUTE_UNUSED is that it's a "may be
> unused" and thus if the code changes it's sometimes left on an parameter
> incorrectly.  C++ allows us to specify a "is definitely unused" concept by
> dropping the parameter's name, but leaving its type.

It's problematic if the parameter is only used conditionally on a macro
definition (which is less common with target hooks now being function
calls).

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/2] RISC-V: delete all the vector psabi checking.

2024-01-19 Thread Andreas Schwab
../../gcc/config/riscv/riscv.cc: In function 'void 
riscv_init_cumulative_args(CUMULATIVE_ARGS*, tree, rtx, tree, int)':
../../gcc/config/riscv/riscv.cc:4879:34: error: unused parameter 'fndecl' 
[-Werror=unused-parameter]
 4879 | tree fndecl,
  | ~^~
../../gcc/config/riscv/riscv.cc: In function 'bool 
riscv_vector_mode_supported_any_target_p(machine_mode)':
../../gcc/config/riscv/riscv.cc:10537:56: error: unused parameter 'mode' 
[-Werror=unused-parameter]
10537 | riscv_vector_mode_supported_any_target_p (machine_mode mode)
  |   ~^~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2559: riscv.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] libstdc++: Update baseline symbols for riscv64-linux

2024-01-17 Thread Andreas Schwab
* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.
---
 .../abi/post/riscv64-linux-gnu/baseline_symbols.txt  | 9 +
 1 file changed, 9 insertions(+)

diff --git 
a/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt 
b/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
index 5ee7f5a0460..a37a0b9a0c9 100644
--- a/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
@@ -497,7 +497,12 @@ FUNC:_ZNKSt11__timepunctIwE7_M_daysEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11__timepunctIwE8_M_am_pmEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.32
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE1EEcvbEv@@GLIBCXX_3.4.31
 FUNC:_ZNKSt12bad_weak_ptr4whatEv@@GLIBCXX_3.4.15
 FUNC:_ZNKSt12future_error4whatEv@@GLIBCXX_3.4.14
 FUNC:_ZNKSt12strstreambuf6pcountEv@@GLIBCXX_3.4
@@ -3210,6 +3215,7 @@ 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@@GLIBCX
 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm@@GLIBCXX_3.4.21
 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_S_compareEmm@@GLIBCXX_3.4.21
 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_capacityEm@@GLIBCXX_3.4.21
+FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_S_allocateERS3_m@@GLIBCXX_3.4.32
 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcOS3_@@GLIBCXX_3.4.23
 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcRKS3_@@GLIBCXX_3.4.21
 
FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC2EPcOS3_@@GLIBCXX_3.4.23
@@ -3362,6 +3368,7 @@ 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_disposeEv@@GLIBCX
 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_replaceEmmPKwm@@GLIBCXX_3.4.21
 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_S_compareEmm@@GLIBCXX_3.4.21
 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_M_capacityEm@@GLIBCXX_3.4.21
+FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_S_allocateERS3_m@@GLIBCXX_3.4.32
 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwOS3_@@GLIBCXX_3.4.23
 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwRKS3_@@GLIBCXX_3.4.21
 
FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC2EPwOS3_@@GLIBCXX_3.4.23
@@ -4523,6 +4530,7 @@ FUNC:__cxa_allocate_exception@@CXXABI_1.3
 FUNC:__cxa_bad_cast@@CXXABI_1.3
 FUNC:__cxa_bad_typeid@@CXXABI_1.3
 FUNC:__cxa_begin_catch@@CXXABI_1.3
+FUNC:__cxa_call_terminate@@CXXABI_1.3.15
 FUNC:__cxa_call_unexpected@@CXXABI_1.3
 FUNC:__cxa_current_exception_type@@CXXABI_1.3
 FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
@@ -4566,6 +4574,7 @@ OBJECT:0:CXXABI_1.3.11
 OBJECT:0:CXXABI_1.3.12
 OBJECT:0:CXXABI_1.3.13
 OBJECT:0:CXXABI_1.3.14
+OBJECT:0:CXXABI_1.3.15
 OBJECT:0:CXXABI_1.3.2
 OBJECT:0:CXXABI_1.3.3
 OBJECT:0:CXXABI_1.3.4
-- 
2.43.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] Fix spurious match in extract_symvers

2024-01-09 Thread Andreas Schwab
Tighten the regex to find the start of the .dynsym symtab in the readelf
output to avoid matching the section symbol in the normal symtab.

libstdc++-v3:
* scripts/extract_symvers.in: Require final colon to only match
.dsynsym in the header of the dynamic symtab.
---
 libstdc++-v3/scripts/extract_symvers.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/scripts/extract_symvers.in 
b/libstdc++-v3/scripts/extract_symvers.in
index 17f0d31bd1c..6bb951c7145 100755
--- a/libstdc++-v3/scripts/extract_symvers.in
+++ b/libstdc++-v3/scripts/extract_symvers.in
@@ -52,7 +52,7 @@ SunOS)
   # Omit _DYNAMIC etc. for consistency with extract_symvers.pl, only
   # present on Solaris.
   ${readelf} ${lib} |\
-  sed -e 's/ \[: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
+  sed -e 's/ \[: [A-Fa-f0-9]*\] //' -e '/\.dynsym.*:$/,/^$/p;d' |\
   sed -e 's/ \[: [0-9]*\] //' |\
   grep -E -v ' (LOCAL|UND) ' |\
   grep -E -v ' 
(_DYNAMIC|_GLOBAL_OFFSET_TABLE_|_PROCEDURE_LINKAGE_TABLE_|_edata|_end|_etext)$' 
|\
-- 
2.43.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v3] LoongArch: testsuite:Added support for vector object detection.

2024-01-09 Thread Andreas Schwab
gcc: gcc.dg/vect/vect-outer-4a-big-array.c -flto -ffat-lto-objects: error 
executing dg-final: unknown effective target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4a-big-array.c: error executing dg-final: unknown 
effective target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4a.c -flto -ffat-lto-objects: error executing 
dg-final: unknown effective target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4a.c: error executing dg-final: unknown effective 
target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4b-big-array.c -flto -ffat-lto-objects: error 
executing dg-final: unknown effective target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4b-big-array.c: error executing dg-final: unknown 
effective target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4b.c -flto -ffat-lto-objects: error executing 
dg-final: unknown effective target keyword `loongarch*-*-*'
gcc: gcc.dg/vect/vect-outer-4b.c: error executing dg-final: unknown effective 
target keyword `loongarch*-*-*'

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] libsanitizer: Enable LSan and TSan for riscv64

2024-01-02 Thread Andreas Schwab
All new (tsan) tests are working as expected.

* configure.tgt (riscv64-*-linux*): Enable LSan and TSan.
---
 libsanitizer/configure.tgt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt
index d24566a2343..38fc7001ff7 100644
--- a/libsanitizer/configure.tgt
+++ b/libsanitizer/configure.tgt
@@ -72,6 +72,11 @@ case "${target}" in
   x86_64-*-solaris2.11* | i?86-*-solaris2.11*)
;;
   riscv64-*-linux*)
+   if test x$ac_cv_sizeof_void_p = x8; then
+   TSAN_SUPPORTED=yes
+   LSAN_SUPPORTED=yes
+   TSAN_TARGET_DEPENDENT_OBJECTS=tsan_rtl_riscv64.lo
+   fi
;;
   loongarch64-*-linux*)
;;
-- 
2.43.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [commit v3 1/2] MIPS: Put the ret to the end of args of reconcat [PR112759]

2023-12-23 Thread Andreas Schwab
On Dez 23 2023, YunQiang Su wrote:

> diff --git a/gcc/config/mips/driver-native.cc 
> b/gcc/config/mips/driver-native.cc
> index afc276f5278..4ef48e14916 100644
> --- a/gcc/config/mips/driver-native.cc
> +++ b/gcc/config/mips/driver-native.cc
> @@ -44,6 +44,8 @@ const char *
>  host_detect_local_cpu (int argc, const char **argv)
>  {
>const char *cpu = NULL;
> +  /* Don't assigne any static string to ret.  If you need to do so,
  assign

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-04 Thread Andreas Schwab
On Dez 04 2023, Siddhesh Poyarekar wrote:

> For hardened code in C, I think we really should look to step away from
> nested functions instead of adding ways to continue supporting it. There's
> probably a larger conversation to be had about the utility of nested
> functions in general for C (and whether this GCC extension should be
> deprecated altogether in future), but I feel like the -fhardened subset
> gives us the opportunity to enforce at least a safe subset for now,
> possibly extending it in future.

Nested functions by itself don't need a trampoline, only if the address
of it is passed outside the containing function's scope (as a callback,
for example).

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [wwwdocs][patch][OpenACC] gcc-14/changes.html: OpenACC - mention support for first 2.7 features

2023-11-26 Thread Andreas Schwab
On Nov 26 2023, Gerald Pfeifer wrote:

> On Fri, 24 Nov 2023, Tobias Burnus wrote:
>> Comments before I commit it?
>
> +  https://gcc.gnu.org/wiki/OpenACC";>OpenACC
> +OpenACC 2.7: The self clause was added to be used on
> +  compute constructs and the default clause for data
> +  constructs.


> +  
> +  
>
> Where does that  come from? I'm afraid this won't validate/render 
> properly.

Neither that extra , I think.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] RISC-V: Implement target attribute

2023-11-17 Thread Andreas Schwab
cv/riscv-target-attr.cc:158:21:
/daten/riscv64/gcc/gcc-20231117/Build/prev-riscv64-suse-linux/libstdc++-v3/include/bits/unique_ptr.h:93:9:
 error: 'void operator delete(void*, std::size_t)' called on pointer returned 
from a mismatched allocation function [-Werror=mismatched-new-delete]
   93 | delete __ptr;
  | ^~~~
In member function 'bool 
{anonymous}::riscv_target_attr_parser::parse_arch(const char*)',
inlined from 'bool {anonymous}::riscv_target_attr_parser::handle_arch(const 
char*)' at ../../gcc/config/riscv/riscv-target-attr.cc:158:21:
../../gcc/config/riscv/riscv-target-attr.cc:108:46: note: returned from 'void* 
operator new [](std::size_t)'
  108 |   std::unique_ptr buf (new char[len]);
  |  ^
cc1plus: all warnings being treated as errors
make[3]: *** [../../gcc/config/riscv/t-riscv:120: riscv-target-attr.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Fix configure script comments(!?!)

2023-11-06 Thread Andreas Schwab
On Nov 06 2023, Martin Jambor wrote:

> Following this commit, our buildbot script which checks that configure
> scripts where re-generated correctly is unhappy because it insists
> comments are wrong, it wants to them to be like this:
>
> 
> diff --git a/gcc/configure b/gcc/configure
> index 4d0357cbc28..0d818ae6850 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -2,7 +2,7 @@ else
>lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>lt_status=$lt_dlunknown
>cat > conftest.$ac_ext <<_LT_EOF
> -#line 19995 "configure"
> +#line 20003 "configure"
>  #include "confdefs.h"
>  
>  #if HAVE_DLFCN_H
> @@ -20106,7 +20106,7 @@ else
>lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>lt_status=$lt_dlunknown
>cat > conftest.$ac_ext <<_LT_EOF
> -#line 20101 "configure"
> +#line 20109 "configure"
>  #include "confdefs.h"
>  
>  #if HAVE_DLFCN_H
> 
>
> I'm not sure what that means, whether a wrong version of
> autoconf/automake was used (though when I accidentally tried that, it
> has always complained loudly) or if some environment difference can
> cause this.

This can happen if commits were rebased without re-generating configure
scripts.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 2/4] maintainer-scripts/gcc_release: create index between snapshots <-> commits

2023-11-02 Thread Andreas Schwab
On Nov 02 2023, Jonathan Wakely wrote:

> Git tags are cheap, but I can imagine a concern about hundreds of new
> tags "littering" the output of 'git tag -l'. I don't _think_ you can
> put tags under an alternative ref that isn't fetched by default (as we
> do with refs/users and refs/vendor). I think tags have to go under
> refs/tags. But grep -v could be used to filter out snapshot tags
> easily.

There is no inherent limitation on publishing tags outside of refs/tags,
to make them invisible by git tag.  There are already existing examples
of tags residing under various refs/users and refs/vendors namespaces.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [Ready to commit V3] RISC-V: Add AVL propagation PASS for RVV auto-vectorization

2023-10-28 Thread Andreas Schwab
../../gcc/config/riscv/riscv-avlprop.cc: In member function 'virtual unsigned 
int pass_avlprop::execute(function*)':
../../gcc/config/riscv/riscv-avlprop.cc:346:23: error: loop variable 
'candidate' creates a copy from type 'const std::pair' [-Werror=range-loop-construct]
  346 |   for (const auto candidate : m_candidates)
  |   ^
../../gcc/config/riscv/riscv-avlprop.cc:346:23: note: use reference type to 
prevent copying
  346 |   for (const auto candidate : m_candidates)
  |   ^
  |       &

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC] Add function attribute: null_terminated_string_arg(PARAM_IDX)

2023-10-19 Thread Andreas Schwab
On Okt 19 2023, David Malcolm wrote:

> +void
> +region_model::
> +check_one_function_attr_null_terminated_string_arg (const gcall *call,
> + tree callee_fndecl,
> + region_model_context *ctxt,
> + rdwr_map &rdwr_idx,
> + tree attr)
> +{
> +  gcc_assert (call);
> +  gcc_assert (callee_fndecl);
> +  gcc_assert (ctxt);
> +  gcc_assert (attr);
> +
> +  tree arg = TREE_VALUE (attr);
> +  if (!arg)
> +return;
> +
> +  /* Convert from 1-based to 0-based index.  */
> +  unsigned int arg_idx = TREE_INT_CST_LOW (TREE_VALUE (arg)) - 1;
> +
> +  /* If there's also an "access" attribute on the ptr param
> + for reading with a size param specified, then that size
> + limits the size of the possible read from the pointer.  */
> +  if (const attr_access* access = rdwr_idx.get (arg_idx))
> +if ((access->mode == access_read_only
> +  || access->mode == access_read_write)
> + && access->sizarg != UINT_MAX)
> +  {
> + /* First, check for a null-terminated string *without*
> +emitting emitting warnings (via a null context), to

-emitting

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: Enable top-level recursive 'autoreconf'

2023-10-19 Thread Andreas Schwab
On Okt 19 2023, Thomas Schwinge wrote:

> Hi!
>
> On 2023-10-18T15:42:18+0100, R jd <3246251196r...@gmail.com> wrote:
>> I guess I can ask, why there is not a recursive approach for configuring
>> GCC. e.g. AC_SUBDIRS in the top level?
>
> ('AC_CONFIG_SUBDIRS' you mean.)  You know, often it just takes someone to
> ask the right questions...  ;-)
>
> What do people think about the attached
> "Enable top-level recursive 'autoreconf'"?  Only lightly tested, so far.

The top-level files are shared with binutils-gdb, which has a different
set of subdirs.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH V2] TEST: Fix vect_cond_arith_* dump checks for RVV

2023-10-09 Thread Andreas Schwab
On Okt 09 2023, juzhe.zh...@rivai.ai wrote:

> Turns out COND(_LEN)?_ADD can't work.

It should work though.  Tcl regexps are a superset of POSIX EREs.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] rtl: fix buidl failure on -fchecking=2 [PR111642]

2023-09-30 Thread Andreas Schwab
On Sep 30 2023, Sergei Trofimovich wrote:

> @@ -263,7 +253,7 @@ const_poly_int_tests::run ()
>ASSERT_KNOWN_EQ (rtx_to_poly_int64 (x255), poly_int64 (1, -1));
>ASSERT_MAYBE_NE (rtx_to_poly_int64 (x255), poly_int64 (1, 255));
>  
> -  /* Test plus_constant of a symbol.  */
> +  /* Test plus_consctant of a symbol.  */

Spurious change.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] analyzer: Call off a superseding when diagnostics are unrelated [PR110830]

2023-09-11 Thread Andreas Schwab via Gcc-patches
../../gcc/analyzer/diagnostic-manager.cc: In function 'bool 
ana::compatible_epath_p(const exploded_path*, const exploded_path*)':
../../gcc/analyzer/diagnostic-manager.cc:969:1: warning: control reaches end of 
non-void function [-Wreturn-type]

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-07-25 Thread Andreas Schwab
On Jul 19 2023, Xiao Zeng wrote:

> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 38d8eb2fcf5..7e6b24bd232 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -2448,6 +2448,17 @@ riscv_rtx_costs (rtx x, machine_mode mode, int 
> outer_code, int opno ATTRIBUTE_UN
> *total = COSTS_N_INSNS (1);
> return true;
>   }
> +  else if (TARGET_ZICOND && outer_code == SET &&
> +   ((GET_CODE (XEXP (x, 1)) == REG && XEXP (x, 2) == const0_rtx) 
> ||
> +   (GET_CODE (XEXP (x, 2)) == REG && XEXP (x, 1) == const0_rtx) 
> ||
> +   (GET_CODE (XEXP (x, 1)) == REG && GET_CODE (XEXP (x, 2)) &&
> +XEXP (x, 1) == XEXP (XEXP (x, 0), 0)) ||
> +   (GET_CODE (XEXP (x, 1)) == REG && GET_CODE (XEXP (x, 2)) &&
> +    XEXP (x, 2) == XEXP (XEXP (x, 0), 0

Line breaks before the operator, not after.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Use substituted GDCFLAGS

2023-07-24 Thread Andreas Schwab via Gcc-patches
Ping?

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 1/2] Fix PR 110066: crash with -pg -static on riscv

2023-07-22 Thread Andreas Schwab
On Jul 22 2023, Andrew Pinski via Gcc-patches wrote:

> The problem -fasynchronous-unwind-tables is on by default for riscv linux
> We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point
> to .eh_frame data from crtbeginT.o instead of the user-defined object
> during static linking.
>
> This turns it off.

Since this is a recurring problem, and difficult to notice (see how long
the aarch64 case went unnoticed), it should be fixed generically,
instead of having to patch every case separately.

> diff --git a/libgcc/config/riscv/t-crtstuff b/libgcc/config/riscv/t-crtstuff
> new file mode 100644
> index 000..685d11b3e66
> --- /dev/null
> +++ b/libgcc/config/riscv/t-crtstuff
> @@ -0,0 +1,5 @@
> +# -fasynchronous-unwind-tables -funwind-tables is on by default for riscv 
> linux
> +# We turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point
> +# to .eh_frame data from crtbeginT.o instead of the user-defined object
> +# during static linking.
> +CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables

What about CRTSTUFF_T_CFLAGS_S?

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH V3] RISC-V: Add TARGET_MIN_VLEN > 4096 check

2023-07-21 Thread Andreas Schwab
../../gcc/config/riscv/riscv.cc: In function 'void riscv_option_override()':
../../gcc/config/riscv/riscv.cc:6716:7: error: misspelled term 'can not' in 
format; use 'cannot' instead [-Werror=format-diag]
 6716 |   "Current RISC-V GCC can not support VLEN > 4096bit for 'V' 
Extension");
  |   
^   
../../gcc/config/riscv/riscv.cc:6716:7: error: unbalanced punctuation character 
'>' in format [-Werror=format-diag]

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] Use substituted GDCFLAGS

2023-07-17 Thread Andreas Schwab via Gcc-patches
Use the substituted value for GCDFLAGS instead of hardcoding $(CFLAGS) so
that the subdir configure scripts use the configured value.

* configure.ac (GDCFLAGS): Set default from ${CFLAGS}.
* configure: Regenerate.
* Makefile.in (GDCFLAGS): Substitute @GDCFLAGS@.
---
 Makefile.in  | 2 +-
 configure| 1 +
 configure.ac | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index 04307ca561b..144bccd2603 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -444,7 +444,7 @@ LIBCFLAGS = $(CFLAGS)
 CXXFLAGS = @CXXFLAGS@
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
 GOCFLAGS = $(CFLAGS)
-GDCFLAGS = $(CFLAGS)
+GDCFLAGS = @GDCFLAGS@
 GM2FLAGS = $(CFLAGS)
 
 # Pass additional PGO and LTO compiler options to the PGO build.
diff --git a/configure b/configure
index 0d3f5c6455d..3269da9829f 100755
--- a/configure
+++ b/configure
@@ -12947,6 +12947,7 @@ fi
 
 
 
+GDCFLAGS=${GDCFLAGS-${CFLAGS}}
 
 # Target tools.
 
diff --git a/configure.ac b/configure.ac
index dddab2a56d8..d07a0fa7698 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3662,6 +3662,7 @@ AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(GDC)
 AC_SUBST(GDCFLAGS)
+GDCFLAGS=${GDCFLAGS-${CFLAGS}}
 
 # Target tools.
 AC_ARG_WITH([build-time-tools], 
-- 
2.41.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [gcc r14-2455] riscv: Prepare backend for index registers

2023-07-17 Thread Andreas Schwab
On Jul 17 2023, Christoph Müllner wrote:

> My host compiler is: gcc version 13.1.1 20230614 (Red Hat 13.1.1-4) (GCC)

Too old.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [gcc r14-2455] riscv: Prepare backend for index registers

2023-07-17 Thread Andreas Schwab
On Jul 17 2023, Christoph Müllner wrote:

> The build process shows a lot of warnings.

Then you are using a bad compiler.  The build is 100% -Werror clean.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [gcc r14-2455] riscv: Prepare backend for index registers

2023-07-14 Thread Andreas Schwab
Why didn't you test that?

../../gcc/config/riscv/riscv.cc: In function 'int 
riscv_regno_ok_for_index_p(int)':
../../gcc/config/riscv/riscv.cc:864:33: error: unused parameter 'regno' 
[-Werror=unused-parameter]
  864 | riscv_regno_ok_for_index_p (int regno)
  | ^
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2499: riscv.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Mark asm goto with outputs as volatile

2023-06-27 Thread Andreas Schwab via Gcc-patches
On Jun 26 2023, Andrew Pinski via Gcc-patches wrote:

> diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
> index 0e24b915b8f..dc6a00e8bd9 100644
> --- a/gcc/gimplify.cc
> +++ b/gcc/gimplify.cc
> @@ -6935,7 +6935,12 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, 
> gimple_seq *post_p)
>stmt = gimple_build_asm_vec (TREE_STRING_POINTER (ASM_STRING (expr)),
>  inputs, outputs, clobbers, labels);
>  
> -  gimple_asm_set_volatile (stmt, ASM_VOLATILE_P (expr) || noutputs == 0);
> +  /* asm is volatile if it was marked by the user as volatile or
> +  there is no outputs or this is an asm goto.  */
   are

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH V1] RISC-V:Add float16 tuple type support

2023-06-25 Thread Andreas Schwab
Please revert until bootstrap is restored.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH V1] RISC-V:Add float16 tuple type support

2023-06-23 Thread Andreas Schwab
../../gcc/lto-streamer-out.cc: In function 'void lto_output_init_mode_table()':
../../gcc/lto-streamer-out.cc:3177:10: error: 'void* memset(void*, int, 
size_t)' forming offset [256, 283] is out of the bounds [0, 256] of object 
'streamer_mode_table' with type 'unsigned char [256]' [-Werror=array-bounds=]
 3177 |   memset (streamer_mode_table, '\0', MAX_MACHINE_MODE);
  |   ~~~^
In file included from ../../gcc/gimple-streamer.h:25,
 from ../../gcc/lto-streamer-out.cc:33:
../../gcc/tree-streamer.h:78:22: note: 'streamer_mode_table' declared here
   78 | extern unsigned char streamer_mode_table[1 << 8];
  |  ^~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1180: lto-streamer-out.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: libgo patch committed: Use a C function to call mmap

2023-06-20 Thread Andreas Schwab
On Jun 20 2023, Ian Lance Taylor wrote:

> OK, but I think that it does have something to do with big-endian.
> The bug was that on some 32-bit systems it was passing a 64-bit value
> to a function that expected a 32-bit value.  The problem didn't show
> up on 32-bit x86 because it is little-endian, and did show up on
> 32-bit PPC because it is big-endian.  I guess the armv7 case was
> failing for a different reason.

Not failing is no proof for correctness.  It fails everywhere for the
same reason.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: libgo patch committed: Use a C function to call mmap

2023-06-20 Thread Andreas Schwab
On Jun 20 2023, Ian Lance Taylor via Gcc-patches wrote:

> This libgo patches changes the runtime pacakge to use a C function to call 
> mmap.
>
> The final argument to mmap, of type off_t, varies. In
> https://go.dev/cl/445375
> (https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604158.html)
> we changed it to always use the C off_t type, but that broke 32-bit
> big-endian Linux systems.

This has nothing to do with big-endian, armv7 isn't big-endian.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [libstdc++] Improve M_check_len

2023-06-20 Thread Andreas Schwab via Gcc-patches
On Jun 20 2023, Jakub Jelinek via Gcc-patches wrote:

> Is it safe even on 64bit targets?  I mean, doesn't say PowerPC already allow
> full 64-bit virtual address space?  The assumption that one can't have
> more than half of virtual address space allocations is true right now at
> least on x86-64, aarch64 and others, but isn't that something that can
> change with newer versions of CPUs without the need to recompile
> applications (add another level or two of page tables)?

At least s390 can allocate more than half the address space.  That
triggered a failure in gawk.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH V2] RISC-V: Rework Phase 5 && Phase 6 of VSETVL PASS

2023-06-16 Thread Andreas Schwab
Why didn't you test that??

../../gcc/config/riscv/riscv-vsetvl.cc: In member function 'bool 
pass_vsetvl::global_eliminate_vsetvl_insn(const rtl_ssa::bb_info*) const':
../../gcc/config/riscv/riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be 
used uninitialized [-Werror=maybe-uninitialized]
 4354 |   if (!vsetvl_rinsn)
  |   ^~
../../gcc/config/riscv/riscv-vsetvl.cc:4343:13: note: 'vsetvl_rinsn' was 
declared here
 4343 |   rtx_insn *vsetvl_rinsn;
  | ^~~~
cc1plus: all warnings being treated as errors
make[3]: *** [../../gcc/config/riscv/t-riscv:66: riscv-vsetvl.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] machine descriptor: New compact syntax for insn and insn_split in Machine Descriptions.

2023-06-08 Thread Andreas Schwab
On Jun 08 2023, Tamar Christina via Gcc-patches wrote:

> @@ -713,6 +714,183 @@ you can use @samp{*} inside of a @samp{@@} 
> multi-alternative template:
>  @end group
>  @end smallexample
>  
> +@node Compact Syntax
> +@section Compact Syntax
> +@cindex compact syntax
> +
> +In cases where the number of alternatives in a @code{define_insn} or
> +@code{define_insn_and_split} are large then it may be beneficial to use the

        is large

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] libstdc++: Use AS_IF in configure.ac

2023-06-07 Thread Andreas Schwab via Gcc-patches
On Jun 07 2023, Jonathan Wakely via Gcc-patches wrote:

> Let's just revert it then. The manual says we should use AS_IF, but what we
> had previously was working well enough. I'll figure out what happened here
> later.

I think AS_IF is doing its job here: moving the expansion of
AC_REQUIRE'd macros out of the bodies.  But many of those expansions
actually need to remain under the $GLIBCXX_IS_NATIVE conditional, so it
is not appropriate at this place.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] RISC-V: Fix warning in predicated.md

2023-06-02 Thread Andreas Schwab
../../gcc/gcc/config/riscv/predicates.md: In function ‘bool arith_operand_or_mod
e_mask(rtx, machine_mode)’:
../../gcc/gcc/config/riscv/predicates.md:33:14: warning: comparison between 
signed and unsigned integer expressions [-Wsign-compare]
 (match_test "INTVAL (op) == GET_MODE_MASK (HImode)

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] riscv: update riscv_asan_shadow_offset

2023-05-30 Thread Andreas Schwab via Gcc-patches
Ok for 12 and 13 branch?

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] riscv: add work around for PR sanitizer/82501

2023-05-30 Thread Andreas Schwab via Gcc-patches
PR sanitizer/82501
* c-c++-common/asan/pointer-compare-1.c: Disable use of small data
on RISC-V.
---
 gcc/testsuite/c-c++-common/asan/pointer-compare-1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/c-c++-common/asan/pointer-compare-1.c 
b/gcc/testsuite/c-c++-common/asan/pointer-compare-1.c
index 4b558bf8179..fb9126d6df1 100644
--- a/gcc/testsuite/c-c++-common/asan/pointer-compare-1.c
+++ b/gcc/testsuite/c-c++-common/asan/pointer-compare-1.c
@@ -5,6 +5,7 @@
 /* FIXME: remove me after PR sanitizer/82501 is resolved.  */
 /* { dg-additional-options "-fno-section-anchors" } */
 /* { dg-additional-options "-msdata=none" { target { powerpc*-*-* } } } */
+/* { dg-additional-options "-msmall-data-limit=0" { target { riscv*-*-* } } } 
*/
 
 volatile int v;
 
-- 
2.40.1


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] riscv: update riscv_asan_shadow_offset

2023-05-30 Thread Andreas Schwab via Gcc-patches
This fixes all asan tests, apart from
c-c++-common/asan/pointer-compare-1.c which needs a workaround for PR
sanitizer/82501.

PR target/110036
* config/riscv/riscv.cc (riscv_asan_shadow_offset): Update to
match libsanitizer.
---
 gcc/config/riscv/riscv.cc | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 09fc9e5d95e..b358ca8b5d0 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -7043,10 +7043,9 @@ riscv_asan_shadow_offset (void)
 {
   /* We only have libsanitizer support for RV64 at present.
 
- This number must match kRiscv*_ShadowOffset* in the file
- libsanitizer/asan/asan_mapping.h which is currently 1<<29 for rv64,
- even though 1<<36 makes more sense.  */
-  return TARGET_64BIT ? (HOST_WIDE_INT_1 << 29) : 0;
+ This number must match ASAN_SHADOW_OFFSET_CONST in the file
+ libsanitizer/asan/asan_mapping.h.  */
+  return TARGET_64BIT ? HOST_WIDE_INT_UC (0xd) : 0;
 }
 
 /* Implement TARGET_MANGLE_TYPE.  */
-- 
2.40.1


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] RISC-V: Add mode switching target hook to insert rounding mode config for fixed-point instructions

2023-05-19 Thread Andreas Schwab
This is built with --disable-werror, so it doesn't fail, but the warning
is there:

https://build.opensuse.org/package/live_build_log/devel:gcc:next/gcc14/openSUSE_Factory_RISCV/riscv64

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] RISC-V: Add mode switching target hook to insert rounding mode config for fixed-point instructions

2023-05-19 Thread Andreas Schwab
In function 'int optimize_mode_switching()',
inlined from 'virtual unsigned int 
{anonymous}::pass_mode_switching::execute(function*)' at 
../../gcc/mode-switching.cc:909:31:
../../gcc/mode-switching.cc:608:29: error: 'bb_info$' may be used uninitialized 
[-Werror=maybe-uninitialized]
  608 | add_seginfo (info + bb->index, ptr);
  | ^~~
../../gcc/mode-switching.cc: In member function 'virtual unsigned int 
{anonymous}::pass_mode_switching::execute(function*)':
../../gcc/mode-switching.cc:503:19: note: 'bb_info$' was declared here
  503 |   struct bb_info *bb_info[N_ENTITIES];
  |   ^~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1174: mode-switching.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: RISC-V Test Errors and Failures

2023-05-17 Thread Andreas Schwab via Gcc-patches
On Mai 16 2023, Vineet Gupta wrote:

> Yes I was seeing similar tcl errors and such - and in my case an even
> higher count.

They are coming from commit d6654a4be3b.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] riscv: Add autovectorization tests for binary integer

2023-05-15 Thread Andreas Schwab via Gcc-patches
In file included from /usr/include/features.h:515,
 from /usr/include/bits/libc-header-start.h:33,
 from /usr/include/stdint.h:26,
 from 
/daten/riscv64/gcc/gcc-20230512/Build/gcc/include/stdint.h:9,
 from 
/daten/riscv64/gcc/gcc-20230512/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-template.h:1,
 from 
/daten/riscv64/gcc/gcc-20230512/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-rv32gcv.c:4:
/usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No such file 
or directory
compilation terminated.
compiler exited with status 1
FAIL: gcc.target/riscv/rvv/autovec/binop/shift-rv32gcv.c (test for excess 
errors)
Excess errors:
/usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No such file 
or directory
compilation terminated.


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v2] RISC-V: Handle multi-lib path correclty for linux

2023-05-12 Thread Andreas Schwab
WTF?

../../gcc/common/config/riscv/riscv-common.cc: In function 'const char* 
riscv_select_multilib_by_abi(const std::string&, const std::string&, const 
riscv_subset_list*, const switchstr*, int, const 
std::vector&)':
../../gcc/common/config/riscv/riscv-common.cc:1599:22: error: unused parameter 
'riscv_current_arch_str' [-Werror=unused-parameter]
 1599 |   const std::string &riscv_current_arch_str,
  |   ~~~^~
../../gcc/common/config/riscv/riscv-common.cc:1601:28: error: unused parameter 
'subset_list' [-Werror=unused-parameter]
 1601 |   const riscv_subset_list *subset_list, const struct switchstr 
*switches,
  |   ~^~~
../../gcc/common/config/riscv/riscv-common.cc:1601:65: error: unused parameter 
'switches' [-Werror=unused-parameter]
 1601 |   const riscv_subset_list *subset_list, const struct switchstr 
*switches,
  | ^~~~
../../gcc/common/config/riscv/riscv-common.cc:1602:7: error: unused parameter 
'n_switches' [-Werror=unused-parameter]
 1602 |   int n_switches, const std::vector 
&multilib_infos)
  |   ^~
../../gcc/common/config/riscv/riscv-common.cc: In function 'const char* 
riscv_select_multilib(const std::string&, const std::string&, const 
riscv_subset_list*, const switchstr*, int, const 
std::vector&)':
../../gcc/common/config/riscv/riscv-common.cc:1613:22: error: unused parameter 
'riscv_current_arch_str' [-Werror=unused-parameter]
 1613 |   const std::string &riscv_current_arch_str,
  |   ~~~^~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2485: riscv-common.o] Error 1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-10 Thread Andreas Schwab
On Mai 09 2023, Peter Bergner via Gcc-patches wrote:

> On 5/9/23 3:50 PM, Andreas Schwab wrote:
>> On Mai 09 2023, Peter Bergner via Gcc-patches wrote:
>> 
>>> It's almost as if the top level build machinery
>>> adds a LD_LIBRARY_PATH=...
>> 
>> See how the toplevel Makefile sets LD_LIBRARY_PATH (via RPATH_ENVVAR) if
>> gcc-bootstrap is set.
>
> I'm sorry to be dense, but can you point to the specific line?  In my
> $GCC_BUILD/Makefile, the only mention of LD_LIBRARY_PATH is:
>
>   RPATH_ENVVAR = LD_LIBRARY_PATH
>
> ...so that isn't setting LD_LIBRARY_PATH, but using it.

Have you considered searching for uses of RPATH_ENVVAR?

$ grep RPATH_ENVVAR Makefile.in 
RPATH_ENVVAR = @RPATH_ENVVAR@
# On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 
's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 
's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 
's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 
's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
# This is the list of directories that may be needed in RPATH_ENVVAR
# This is the list of directories that may be needed in RPATH_ENVVAR
"RPATH_ENVVAR=$(RPATH_ENVVAR)" \

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-09 Thread Andreas Schwab
On Mai 09 2023, Peter Bergner via Gcc-patches wrote:

> It's almost as if the top level build machinery
> adds a LD_LIBRARY_PATH=...

See how the toplevel Makefile sets LD_LIBRARY_PATH (via RPATH_ENVVAR) if
gcc-bootstrap is set.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5 09/11] RISC-V: Weaken mem_thread_fence

2023-05-03 Thread Andreas Schwab via Gcc-patches
../../gcc/config/riscv/sync.md: In function 'const char* output_479(rtx_def**, 
rtx_insn*)':
../../gcc/config/riscv/sync.md:66:1: error: control reaches end of non-void 
function [-Werror=return-type]
   66 |   [(set (attr "length") (const_int 4))])
      | ^

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] riscv: Don't add -latomic with -pthread

2023-05-03 Thread Andreas Schwab via Gcc-patches
Now that we have support for inline subword atomic operations, it is no
longer necessary to link against libatomic.  This also fixes testsuite
failures because the framework does not properly set up the linker flags
for finding libatomic.
The use of atomic operations is also independent of the use of libpthread.
---
 gcc/config/riscv/linux.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index b9557a75dc7..2fdfd930cf2 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -35,16 +35,6 @@ along with GCC; see the file COPYING3.  If not see
 #undef MUSL_DYNAMIC_LINKER
 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-riscv" XLEN_SPEC MUSL_ABI_SUFFIX 
".so.1"
 
-/* Because RISC-V only has word-sized atomics, it requries libatomic where
-   others do not.  So link libatomic by default, as needed.  */
-#undef LIB_SPEC
-#ifdef LD_AS_NEEDED_OPTION
-#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \
-  " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}"
-#else
-#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
-#endif
-
 #define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
 
 #define CPP_SPEC "%{pthread:-D_REENTRANT}"
-- 
2.40.1


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] RISC-V: Fix sync.md and riscv.cc whitespace errors

2023-04-26 Thread Andreas Schwab
On Apr 26 2023, Patrick O'Neill wrote:

> @@ -290,10 +290,10 @@
>[(set (match_operand:GPR 0 "register_operand" "=&r")
>   (match_operand:GPR 1 "memory_operand" "+A"))
> (set (match_dup 1)
> - (unspec_volatile:GPR [(match_operand:GPR 2 "reg_or_0_operand" "rJ")
> -   (match_operand:GPR 3 "reg_or_0_operand" "rJ")
> -   (match_operand:SI 4 "const_int_operand")  ;; mod_s
> -   (match_operand:SI 5 "const_int_operand")] ;; mod_f
> + (unspec_volatile:GPR[(match_operand:GPR 2 "reg_or_0_operand" "rJ")
> +  (match_operand:GPR 3 "reg_or_0_operand" "rJ")
> +  (match_operand:SI 4 "const_int_operand")  ;; mod_s
> +  (match_operand:SI 5 "const_int_operand")] ;; mod_f

That appears to be a bug in the checker.  This isn't a C array
expression, but an argument in lispy vector notation, so it should be
separated by a space.

> @@ -431,15 +431,15 @@
>  })
>
>  (define_insn "subword_atomic_cas_strong"
> -  [(set (match_operand:SI 0 "register_operand" "=&r")
>;; old value at mem
> - (match_operand:SI 1 "memory_operand" "+A"));; 
> mem location
> +  [(set (match_operand:SI 0 "register_operand" "=&r")
>   ;; old value at mem
> + (match_operand:SI 1 "memory_operand" "+A"))   ;; 
> mem location
> (set (match_dup 1)
> - (unspec_volatile:SI [(match_operand:SI 2 "reg_or_0_operand" "rJ")  ;; 
> expected value
> -  (match_operand:SI 3 "reg_or_0_operand" "rJ")] ;; 
> desired value
> + (unspec_volatile:SI[(match_operand:SI 2 "reg_or_0_operand" "rJ")  ;; 
> expected value
> + (match_operand:SI 3 "reg_or_0_operand" "rJ")] ;; 
> desired value

Likewise.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Turn on LRA on all targets

2023-04-24 Thread Andreas Schwab
Here is the result for m68k:

libtool: compile:  /daten/aranym/gcc/gcc-20230424/Build/./gcc/xgcc 
-shared-libgcc -B/daten/aranym/gcc/gcc-20230424/Build/./gcc -nostdinc++ 
-L/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/src 
-L/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/src/.libs 
-L/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/libsupc++/.libs 
-B/daten/cross/m68k-linux/m68k-linux/bin/ 
-B/daten/cross/m68k-linux/m68k-linux/lib/ -isystem 
/daten/cross/m68k-linux/m68k-linux/include -isystem 
/daten/cross/m68k-linux/m68k-linux/sys-include 
-I/daten/aranym/gcc/gcc-20230424/libstdc++-v3/../libgcc 
-I/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/include/m68k-linux
 -I/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/include 
-I/daten/aranym/gcc/gcc-20230424/libstdc++-v3/libsupc++ -std=gnu++11 
-D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings 
-Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections 
-fdata-sections -frandom-seed=wlocale-inst.lo -g -O2 -D_GNU_SOURCE -c 
../../../../../libstdc++-v3/src/c++11/wlocale-inst.cc  -fPIC -DPIC 
-D_GLIBCXX_SHARED -o wlocale-inst.o
during RTL pass: reload
In file included from 
/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/include/bits/locale_facets.h:2687,
 from 
/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/include/locale:42,
 from ../../../../../libstdc++-v3/src/c++11/locale-inst.cc:38,
 from ../../../../../libstdc++-v3/src/c++11/wlocale-inst.cc:35:
/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/include/bits/locale_facets.tcc:
 In member function '_InIter std::num_get<_CharT, _InIter>::do_get(iter_type, 
iter_type, std::ios_base&, std::ios_base::iostate&, bool&) const [with _CharT = 
wchar_t; _InIter = std::istreambuf_iterator 
>]':
/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/include/bits/locale_facets.tcc:686:5:
 internal compiler error: maximum number of generated reload insns per insn 
achieved (90)
  686 | }
  | ^
0xe8a5e8 lra_constraints(bool)
../../gcc/lra-constraints.cc:5319
0xe71f32 lra(_IO_FILE*)
../../gcc/lra.cc:2375
0xe21731 do_reload
../../gcc/ira.cc:5967
0xe21731 execute
../../gcc/ira.cc:6153

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


  1   2   3   4   5   6   7   8   9   10   >