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

            Bug ID: 124387
           Summary: Some Questions About Instruction Selection for umlal
                    smlalbb in GCC 14.3.0
           Product: gcc
           Version: 14.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 314575546 at qq dot com
  Target Milestone: ---

Hello, I have a question I'd like to ask. This issue might not be a compilation
bug, but GCC 14.3.0 fails to pass two test cases in the DejaGnu test suite.

gcc.target/arm/wmul-6.c
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target arm_dsp } */

long long
foo (long long a, unsigned char *b, signed char *c)
{
  return a + (long long)*b * (long long)*c;
}

/* { dg-final { scan-assembler "smlalbb" } } */


gcc.target/arm/wmul-7.c
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target arm_dsp } */

unsigned long long
foo (unsigned long long a, unsigned char *b, unsigned short *c)
{
  return a + *b * *c;
}

/* { dg-final { scan-assembler "umlal" } } */

https://godbolt.org/z/r1Kx1nGoP

In the wmul-7.c test case, the return value type of the function is unsigned,
but the instruction used in the assembly code is signed. Can GCC analyze and
confirm that the value range does not exceed the signed threshold to ensure the
accuracy of the result?

Does the failure of GCC to pass all test cases affect the quality of GCC?
I am a beginner, please forgive my ignorance.

Reply via email to