public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107358] New: [13 Regression] i686-linux: Since r13-3290-g98e341130f8798 code fails to build libjxl-0/7.0 (vector float code)
Date: Sat, 22 Oct 2022 12:57:32 +0000	[thread overview]
Message-ID: <bug-107358-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2022-10-22 12:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22 12:57 slyfox at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107358-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).