From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13691 invoked by alias); 27 Jun 2012 05:40:15 -0000 Received: (qmail 13562 invoked by uid 22791); 27 Jun 2012 05:40:13 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_AV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jun 2012 05:40:00 +0000 From: "dag at nimrod dot no" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53784] New: Scalar vector binary operation - error with -std=c9x/c1x Date: Wed, 27 Jun 2012 05:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dag at nimrod dot no X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg01763.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53784 Bug #: 53784 Summary: Scalar vector binary operation - error with -std=c9x/c1x Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: dag@nimrod.no Test code: ---------- typedef float v8sf __attribute__ ((vector_size (4*8))); v8sf add_scalar(v8sf v, float s) { return v + s; } ---------- If any non-GNU language standard is chosen (e.g. gcc -std=c99 -mavx -S test.c), the compilation fails with the following error: error: conversion of scalar to vector involves truncation As far as I can tell, there should not be any truncation involved here. Adding -ffast-math makes gcc accept the code.