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

--- Comment #15 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 13 Apr 2023, xry111 at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108357
> 
> --- Comment #14 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
> (In reply to rguent...@suse.de from comment #13)
> > On Thu, 13 Apr 2023, chenglulu at loongson dot cn wrote:
> > 
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108357
> > > 
> > > --- Comment #10 from chenglulu <chenglulu at loongson dot cn> ---
> > > (In reply to Xi Ruoyao from comment #5)
> > > > The test fails on loongarch64-linux-gnu.  foo is kept in 
> > > > 114t.threadfull1,
> > > > but removed in 135t.forwprop3.
> > > > 
> > > > Does this mean something is wrong for LoongArch, or we should simply 
> > > > check
> > > > the tree dump in a later pass (for e.g. 254t.optimized)?
> > > 
> > > If the definition of the macro DEFAULT_SIGNED_CHAR is changed to 0, the 
> > > test
> > > case can pass the test. I guess it is because the definition of
> > > DEFAULT_SIGNED_CHAR affects the optimization of the ccp pass, resulting 
> > > in some
> > > blocks that cannot be removed, resulting in the failure of this test case.
> > 
> > Can you check if making b unsigned fixes the test for you?  If so
> > that's what we should do.
> 
> It works?
> 
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c
> b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c
> index 44c457b7a97..79cf371ef28 100644
> --- a/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c
> @@ -1,7 +1,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -fdump-tree-threadfull1" } */
> 
> -static char b;
> +static unsigned char b;
>  static unsigned c;
>  void foo();
>  short(a)(short d, short e) { return d * e; }
> 
> But I'm still wondering why this is not an issue for x86_64.

Yes, that's interesting to see.  It does change how b is extended
in b ^ 9854 (but for the value zero it doesn't matter).

Reply via email to