public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/42957]  New: ARM: Segfault when invalid -mfpu argument is specified.
@ 2010-02-04 16:12 rmansfield at qnx dot com
  2010-02-06 14:05 ` [Bug target/42957] " rearnsha at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rmansfield at qnx dot com @ 2010-02-04 16:12 UTC (permalink / raw)
  To: gcc-bugs

ryan@zoidberg:~/gnu/gcc/trunk/build/gcc$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: arm-unknown-linux-gnueabi
Configured with: ../configure --target=arm-unknown-linux-gnueabi
--prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi
--with-sysroot=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root
--enable-languages=c,c++ --disable-multilib --with-float=soft
--disable-sjlj-exceptions --enable-__cxa_atexit
--with-local-prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99
--enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.5.0 20100204 (experimental) [trunk revision 156492] (GCC) 

ryan@zoidberg:~/gnu/gcc/trunk/build/gcc$ touch t.c
ryan@zoidberg:~/gnu/gcc/trunk/build/gcc$ ./cc1plus -quiet t.c -mfpu=foo
t.c:1:0: error: invalid floating point option: -mfpu=foo
t.c:1:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
(gdb) bt
#0  0x08a06fd6 in arm_override_options () at ../../gcc/config/arm/arm.c:1645
#1  0x087b7a6c in process_options () at ../../gcc/toplev.c:1810
#2  0x087b8528 in do_compile () at ../../gcc/toplev.c:2389
#3  0x087b8624 in toplev_main (argc=4, argv=0xbffff364)
    at ../../gcc/toplev.c:2447
#4  0x083cd2ab in main (argc=4, argv=0xbffff364) at ../../gcc/main.c:35

Patch:

2010-02-04  Ryan Mansfield  <rmansfield@qnx.com>
        PR target/xxxxx
        * config/arm/arm.c (arm_override_options): Handle invalid arguments to
        -mfpu.

Index: arm.c
===================================================================
--- arm.c       (revision 156492)
+++ arm.c       (working copy)
@@ -1292,6 +1292,7 @@
   unsigned i;
   enum processor_type target_arch_cpu = arm_none;
   enum processor_type selected_cpu = arm_none;
+  const char *default_fpu_name;

   /* Set up the flags based on the cpu/architecture selected by the user.  */
   for (i = ARRAY_SIZE (arm_select); i--;)
@@ -1618,29 +1619,31 @@
               target_fpe_name);
     }

-  if (target_fpu_name == NULL)
-    {
 #ifdef FPUTYPE_DEFAULT
-      target_fpu_name = FPUTYPE_DEFAULT;
+  default_fpu_name = FPUTYPE_DEFAULT;
 #else
-      if (arm_arch_cirrus)
-       target_fpu_name = "maverick";
-      else
-       target_fpu_name = "fpe2";
+  if (arm_arch_cirrus)
+    default_fpu_name = "maverick";
+  else
+    default_fpu_name = "fpe2";
 #endif
-    }

   arm_fpu_desc = NULL;
   for (i = 0; i < ARRAY_SIZE (all_fpus); i++)
     {
-      if (streq (all_fpus[i].name, target_fpu_name))
-       {
-         arm_fpu_desc = &all_fpus[i];
-         break;
-       }
-    }
-  if (!arm_fpu_desc)
-    error ("invalid floating point option: -mfpu=%s", target_fpu_name);
+      if (streq (all_fpus[i].name, default_fpu_name))
+       arm_fpu_desc = &all_fpus[i];
+      if (target_fpu_name) 
+        {
+          if (streq (all_fpus[i].name, target_fpu_name))
+           {
+             arm_fpu_desc = &all_fpus[i];
+             break;
+           }
+          if (i == ARRAY_SIZE (all_fpus) - 1)
+           error ("invalid floating point option: -mfpu=%s", target_fpu_name);
+        }
+    } 

   switch (arm_fpu_desc->model)
     {


-- 
           Summary: ARM: Segfault when invalid -mfpu argument is specified.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rmansfield at qnx dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: arm-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42957


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

* [Bug target/42957] ARM: Segfault when invalid -mfpu argument is specified.
  2010-02-04 16:12 [Bug target/42957] New: ARM: Segfault when invalid -mfpu argument is specified rmansfield at qnx dot com
@ 2010-02-06 14:05 ` rearnsha at gcc dot gnu dot org
  2010-02-06 14:05 ` rearnsha at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2010-02-06 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rearnsha at gcc dot gnu dot org  2010-02-06 14:05 -------
Confirmed.


-- 

rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-02-06 14:05:03
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42957


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

* [Bug target/42957] ARM: Segfault when invalid -mfpu argument is specified.
  2010-02-04 16:12 [Bug target/42957] New: ARM: Segfault when invalid -mfpu argument is specified rmansfield at qnx dot com
  2010-02-06 14:05 ` [Bug target/42957] " rearnsha at gcc dot gnu dot org
@ 2010-02-06 14:05 ` rearnsha at gcc dot gnu dot org
  2010-02-06 14:06 ` rearnsha at gcc dot gnu dot org
  2010-03-24 17:43 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2010-02-06 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rearnsha at gcc dot gnu dot org  2010-02-06 14:05 -------
Subject: Bug 42957

Author: rearnsha
Date: Sat Feb  6 14:05:27 2010
New Revision: 156539

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156539
Log:
        PR target/42957
        * arm.c (arm_override_options): Just return if the user has specified
        an invalid fpu name.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42957


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

* [Bug target/42957] ARM: Segfault when invalid -mfpu argument is specified.
  2010-02-04 16:12 [Bug target/42957] New: ARM: Segfault when invalid -mfpu argument is specified rmansfield at qnx dot com
  2010-02-06 14:05 ` [Bug target/42957] " rearnsha at gcc dot gnu dot org
  2010-02-06 14:05 ` rearnsha at gcc dot gnu dot org
@ 2010-02-06 14:06 ` rearnsha at gcc dot gnu dot org
  2010-03-24 17:43 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2010-02-06 14:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rearnsha at gcc dot gnu dot org  2010-02-06 14:05 -------
Fixed.


-- 

rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42957


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

* [Bug target/42957] ARM: Segfault when invalid -mfpu argument is specified.
  2010-02-04 16:12 [Bug target/42957] New: ARM: Segfault when invalid -mfpu argument is specified rmansfield at qnx dot com
                   ` (2 preceding siblings ...)
  2010-02-06 14:06 ` rearnsha at gcc dot gnu dot org
@ 2010-03-24 17:43 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-24 17:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2010-03-24 17:42 -------
*** Bug 43510 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hans dot buchmann at fhnw
                   |                            |dot ch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42957


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

end of thread, other threads:[~2010-03-24 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04 16:12 [Bug target/42957] New: ARM: Segfault when invalid -mfpu argument is specified rmansfield at qnx dot com
2010-02-06 14:05 ` [Bug target/42957] " rearnsha at gcc dot gnu dot org
2010-02-06 14:05 ` rearnsha at gcc dot gnu dot org
2010-02-06 14:06 ` rearnsha at gcc dot gnu dot org
2010-03-24 17:43 ` pinskia at gcc dot gnu dot 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).