[4.7,committed] Clear MASK_ALTIVEC if no OS support

Submitted by David Edelsohn on Feb. 8, 2013, 2:58 p.m.

Details

Message ID CAGWvnyksu4njOLkErB=9OtpgsS3PAwoJqi6TnsPmznA7Nhbetw@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Feb. 8, 2013, 2:58 p.m.
The -mcpu=XXX options enable processor features, including Altivec and
VSX.  Some OS releases do not have support for that feature.  GCC
included code to clear those features for Altivec, but it had not been
updated when VSX was added.  This was fixed on mainline as part of the
general masks cleanup, but had not been backported to GCC 4.7 and GCC
4.6.

Thanks, David

        * config/rs6000/rs6000.c (rs6000_option_override_internal): Clear
        MASK_VSX from set_masks if OS_MISSING_ALTIVEC.

Patch hide | download patch | download mbox

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 195886)
+++ rs6000.c    (working copy)
@@ -1,7 +1,7 @@ 
 /* Subroutines used for code generation on IBM RS/6000.
    Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-   2012
+   2012, 2013
    Free Software Foundation, Inc.
    Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)

@@ -2646,7 +2646,7 @@ 
 #endif
 #ifdef OS_MISSING_ALTIVEC
   if (OS_MISSING_ALTIVEC)
-    set_masks &= ~MASK_ALTIVEC;
+    set_masks &= ~(MASK_ALTIVEC | MASK_VSX);
 #endif

   /* Don't override by the processor default if given explicitly.  */