public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107358] New: [13 Regression] i686-linux: Since r13-3290-g98e341130f8798 code fails to build libjxl-0/7.0 (vector float code)
@ 2022-10-22 12:57 slyfox at gcc dot gnu.org
  2022-10-22 13:14 ` [Bug c++/107358] " jakub at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: slyfox at gcc dot gnu.org @ 2022-10-22 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107358
           Summary: [13 Regression] i686-linux: Since
                    r13-3290-g98e341130f8798 code fails to build
                    libjxl-0/7.0 (vector float code)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org, jakub at redhat dot com
  Target Milestone: ---

Initially observed build failure on libjxl-0.7.0 on i686-linux target.

Seems to happen only on i686-unknown-linux-gnu and only on -std=c++11.

PR107295 does not seem to be enough to fix it. Here is the minimal example:

// $ cat skcms.cc
// this works:
float approx_scal(float e) {
    return e - 124.225514990f;
}

typedef float __attribute__((vector_size(4*sizeof(float)))) F;

// this fails:
//   error: conversion of scalar 'long double' to vector 'F' {aka '__vector(4)
float'} involves truncation
F approx_vec(F e) {
    return e - 124.225514990f;
    //return e - 1.0f; // this works, does 'f' get ignored when float does not
fit?
}


$ g++-13 -fPIC -std=c++11 -o skcms.cc.o -c skcms.cc
skcms.cc: In function 'F approx_vec(F)':
skcms.cc:10:17: warning: SSE vector return without SSE enabled changes the ABI
[-Wpsabi]
   10 | F approx_vec(F e) {
      |                 ^
skcms.cc:11:14: error: conversion of scalar 'long double' to vector 'F' {aka
'__vector(4) float'} involves truncation
   11 |     return e - 124.225514990f;
      |            ~~^~~~~~~~~~~~~~~~

$ g++-12 -fPIC -std=c++11 -o skcms.cc.o -c skcms.cc
skcms.cc: In function 'F approx_vec(F)':
skcms.cc:10:17: warning: SSE vector return without SSE enabled changes the ABI
[-Wpsabi]
   10 | F approx_vec(F e) {
      |                 ^
skcms.cc:10:3: note: the ABI for passing parameters with 16-byte alignment has
changed in GCC 4.6
   10 | F approx_vec(F e) {
      |   ^~~~~~~~~~
skcms.cc:10:3: warning: SSE vector argument without SSE enabled changes the ABI 

Note: gcc-12 works, gcc-13 fails.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-05-04  7:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-22 12:57 [Bug c++/107358] New: [13 Regression] i686-linux: Since r13-3290-g98e341130f8798 code fails to build libjxl-0/7.0 (vector float code) slyfox at gcc dot gnu.org
2022-10-22 13:14 ` [Bug c++/107358] " jakub at gcc dot gnu.org
2022-10-22 17:30 ` jakub at gcc dot gnu.org
2022-10-22 23:07 ` slyfox at gcc dot gnu.org
2022-10-24 13:01 ` rguenth at gcc dot gnu.org
2022-10-24 15:54 ` cvs-commit at gcc dot gnu.org
2022-10-24 15:55 ` jakub at gcc dot gnu.org
2022-11-03  0:23 ` cvs-commit at gcc dot gnu.org
2022-11-04  8:31 ` cvs-commit at gcc dot gnu.org
2022-11-04 11:01 ` jakub at gcc dot gnu.org
2023-05-03 15:19 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:21 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).