public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
@ 2015-03-05 13:18 ` slomo at coaxion dot net
  2015-03-05 13:57 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: slomo at coaxion dot net @ 2015-03-05 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

Sebastian Dröge <slomo at coaxion dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slomo at coaxion dot net

--- Comment #1 from Sebastian Dröge <slomo at coaxion dot net> ---
To provide more details, the code in question is basically

float x = ...;
int y = x * INTEGER_LITERAL;

if x < 1.0, this always resulted in 0. Adding casts like

int y = (int) ((double) x * (double) INTEGER_LITERAL);

fixed it.


The problem only happened with -O1 and -O2 on ARM(v7), not with -O0. And also
went away after adding some debug printf() around the code in question.


gcc 4.9 was used here.
>From gcc-bugs-return-479465-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 05 13:20:14 2015
Return-Path: <gcc-bugs-return-479465-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 59688 invoked by alias); 5 Mar 2015 13:20:14 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 59650 invoked by uid 48); 5 Mar 2015 13:20:10 -0000
From: "slomo at coaxion dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/65325] float/interger operation needs cast with 02 switch.
Date: Thu, 05 Mar 2015 13:20:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.9.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: slomo at coaxion dot net
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65325-4-FrZbg6LySL@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65325-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65325-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00609.txt.bz2
Content-length: 239

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

--- Comment #2 from Sebastian Dröge <slomo at coaxion dot net> ---
http://comments.gmane.org/gmane.linux.embedded.yocto.meta-freescale/13018 also
has other mentions of this bug.
>From gcc-bugs-return-479466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 05 13:54:57 2015
Return-Path: <gcc-bugs-return-479466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 110927 invoked by alias); 5 Mar 2015 13:54:57 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 110659 invoked by uid 55); 5 Mar 2015 13:54:51 -0000
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/65319] FAIL: g++.dg/other/dump-ada-spec-3.C  -std=gnu++98 (internal compiler error)
Date: Thu, 05 Mar 2015 13:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ada
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ebotcazou at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65319-4-LLnMn3JedJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65319-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65319-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00610.txt.bz2
Content-length: 418

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide319

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Thu Mar  5 13:54:19 2015
New Revision: 221213

URL: https://gcc.gnu.org/viewcvs?rev"1213&root=gcc&view=rev
Log:
    PR ada/65319
    * c-ada-spec.c (print_destructor): Remove obsolete code.

Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-ada-spec.c


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
  2015-03-05 13:18 ` [Bug c/65325] float/interger operation needs cast with 02 switch slomo at coaxion dot net
@ 2015-03-05 13:57 ` mpolacek at gcc dot gnu.org
  2015-03-05 16:07 ` scerveau@connected-labs.com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-05 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-03-05
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Can you please provide a stand-alone testcase (that maybe calls abort() if the
alleged bug occurs)?


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
  2015-03-05 13:18 ` [Bug c/65325] float/interger operation needs cast with 02 switch slomo at coaxion dot net
  2015-03-05 13:57 ` mpolacek at gcc dot gnu.org
@ 2015-03-05 16:07 ` scerveau@connected-labs.com
  2015-03-05 16:09 ` scerveau@connected-labs.com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: scerveau@connected-labs.com @ 2015-03-05 16:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Stephane Cerveau <scerveau@connected-labs.com> ---
http://pastebin.com/stQFwaSg

Here is a sample which is supposed to describe the same behaviour as in
gstvolume.c but i'm not able to reproduce it with this code.

Here is my build command line:

arm-oad-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a9 -O2 -pipe -g -feliminate-unused-debug-types
test_float.c -o test_float


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-03-05 16:07 ` scerveau@connected-labs.com
@ 2015-03-05 16:09 ` scerveau@connected-labs.com
  2015-03-05 21:27 ` slomo at coaxion dot net
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: scerveau@connected-labs.com @ 2015-03-05 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Stephane Cerveau <scerveau@connected-labs.com> ---
Created attachment 34963
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34963&action=edit
assembly code

Here is the command line:

arm-oad-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a9
--sysroot=/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter
-std=gnu99 -DHAVE_CONFIG_H -I.
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/work/cortexa9hf-vfp-neon-mx6-oad-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst/volume
-I../..
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/work/cortexa9hf-vfp-neon-mx6-oad-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst-libs
-I../../gst-libs -pthread
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/gstreamer-1.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/glib-2.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/lib/glib-2.0/include
-pthread
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/glib-2.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/lib/glib-2.0/include
-pthread
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/gstreamer-1.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/glib-2.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/lib/glib-2.0/include
-DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -Wall
-Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations
-Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings
-Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs
-Waddress -Waggregate-return -Wno-multichar -Wnested-externs
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/orc-0.4
-O2 -pipe -g -feliminate-unused-debug-types -S
/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/work/cortexa9hf-vfp-neon-mx6-oad-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst/volume/gstvolume.c
 -fPIC -DPIC -o .libs/libgstvolume_la-gstvolume.o


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-03-05 16:09 ` scerveau@connected-labs.com
@ 2015-03-05 21:27 ` slomo at coaxion dot net
  2015-03-06  9:16 ` scerveau@connected-labs.com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: slomo at coaxion dot net @ 2015-03-05 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Sebastian Dröge <slomo at coaxion dot net> ---
Can you provide the assembly code with and without the added casts?
>From gcc-bugs-return-479528-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 05 21:29:16 2015
Return-Path: <gcc-bugs-return-479528-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 111290 invoked by alias); 5 Mar 2015 21:29:16 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 111223 invoked by uid 48); 5 Mar 2015 21:29:13 -0000
From: "meissner at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/65138] testsuite ICEs on powerpc64le
Date: Thu, 05 Mar 2015 21:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: meissner at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: meissner at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-65138-4-5DXueGKrKM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65138-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65138-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00672.txt.bz2
Content-length: 525

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide138

Michael Meissner <meissner at gcc dot gnu.org> changed:

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

--- Comment #20 from Michael Meissner <meissner at gcc dot gnu.org> ---
Trunk patches committed on March 2-3rd, 2015.  Gcc 4.9/4.8 patches committed on
March 5th, 2015.


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-03-05 21:27 ` slomo at coaxion dot net
@ 2015-03-06  9:16 ` scerveau@connected-labs.com
  2015-03-06 10:43 ` scerveau@connected-labs.com
  2015-03-06 11:16 ` slomo at coaxion dot net
  7 siblings, 0 replies; 8+ messages in thread
From: scerveau@connected-labs.com @ 2015-03-06  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Stephane Cerveau <scerveau@connected-labs.com> ---
It is already without the cast ...


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-03-06  9:16 ` scerveau@connected-labs.com
@ 2015-03-06 10:43 ` scerveau@connected-labs.com
  2015-03-06 11:16 ` slomo at coaxion dot net
  7 siblings, 0 replies; 8+ messages in thread
From: scerveau@connected-labs.com @ 2015-03-06 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Stephane Cerveau <scerveau@connected-labs.com> ---
Created attachment 34973
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34973&action=edit
assembly code

This is the version with float casting


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

* [Bug c/65325] float/interger operation needs cast with 02 switch.
       [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-03-06 10:43 ` scerveau@connected-labs.com
@ 2015-03-06 11:16 ` slomo at coaxion dot net
  7 siblings, 0 replies; 8+ messages in thread
From: slomo at coaxion dot net @ 2015-03-06 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Sebastian Dröge <slomo at coaxion dot net> ---
The assembly code looks exactly the same to me, except for the source
locations. But I also don't see the multiplication in either, only conversion
between integers and floating point values, and then storing the results. It's
near line 254 in the original source for both.
>From gcc-bugs-return-479555-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 06 11:47:53 2015
Return-Path: <gcc-bugs-return-479555-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 105661 invoked by alias); 6 Mar 2015 11:47:52 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 105623 invoked by uid 48); 6 Mar 2015 11:47:48 -0000
From: "jb at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/65200] Handle EPERM when opening files
Date: Fri, 06 Mar 2015 11:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libfortran
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jb at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65200-4-pSctOpAw8i@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65200-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65200-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00699.txt.bz2
Content-length: 2454

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide200

--- Comment #3 from Janne Blomqvist <jb at gcc dot gnu.org> ---
Untested patch:

Index: io/open.c
==================================================================--- io/open.c   (revision 221202)
+++ io/open.c   (working copy)
@@ -502,34 +502,12 @@
   s = open_external (opp, flags);
   if (s == NULL)
     {
+      char tmpmsg[256];
       char *path = fc_strdup (opp->file, opp->file_len);
-      size_t msglen = opp->file_len + 51;
+      size_t msglen = opp->file_len + 22 + 256;
       char *msg = xmalloc (msglen);
-
-      switch (errno)
-       {
-       case ENOENT:
-         snprintf (msg, msglen, "File '%s' does not exist", path);
-         break;
-
-       case EEXIST:
-         snprintf (msg, msglen, "File '%s' already exists", path);
-         break;
-
-       case EACCES:
-         snprintf (msg, msglen,
-                   "Permission denied trying to open file '%s'", path);
-         break;
-
-       case EISDIR:
-         snprintf (msg, msglen, "'%s' is a directory", path);
-         break;
-
-       default:
-         free (msg);
-         msg = NULL;
-       }
-
+      snprintf (msg, msglen, "Cannot open file '%s': %s", path,
+               gf_strerror (errno, tmpmsg, 256));
       generate_error (&opp->common, LIBERROR_OS, msg);
       free (msg);
       free (path);
Index: io/unix.c
==================================================================--- io/unix.c   (revision 221202)
+++ io/unix.c   (working copy)
@@ -1353,7 +1353,7 @@
       flags->action = ACTION_READWRITE;
       return fd;
     }
-  if (errno != EACCES && errno != EROFS)
+  if (errno != EACCES && errno != EPERM && errno != EROFS)
      return fd;

   /* retry for read-only access */
@@ -1369,7 +1369,7 @@
       return fd;               /* success */
     }

-  if (errno != EACCES && errno != ENOENT)
+  if (errno != EACCES && errno != EPERM && errno != ENOENT)
     return fd;                 /* failure */

   /* retry for write-only access */


It also fixes a wart in io/open.c, where we previously hardcoded error messages
for a few errno values, which is a bit silly as strerror{_l,_r} already
provides a mapping from errno -> string.

Still TODO: Docs about the processor dependent behavior when opening files with
no ACTION= specifier. Fortran 2008, 9.5.6.4 (ACCESS= specifier in OPEN
statement): "If this specifier is omitted, the default value is processor
dependent."


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

end of thread, other threads:[~2015-03-06 11:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-65325-4@http.gcc.gnu.org/bugzilla/>
2015-03-05 13:18 ` [Bug c/65325] float/interger operation needs cast with 02 switch slomo at coaxion dot net
2015-03-05 13:57 ` mpolacek at gcc dot gnu.org
2015-03-05 16:07 ` scerveau@connected-labs.com
2015-03-05 16:09 ` scerveau@connected-labs.com
2015-03-05 21:27 ` slomo at coaxion dot net
2015-03-06  9:16 ` scerveau@connected-labs.com
2015-03-06 10:43 ` scerveau@connected-labs.com
2015-03-06 11:16 ` slomo at coaxion dot net

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).