Bug 1063327 - gcc: internal compiler error: Bus error (program cc1)
Summary: gcc: internal compiler error: Bus error (program cc1)
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 19
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-02-10 14:03 UTC by Srdan Suka
Modified: 2015-02-17 10:24 UTC (History)
4 users (show)

Clone Of:
Last Closed: 2015-02-17 10:24:08 UTC

Attachments (Terms of Use)

Description Srdan Suka 2014-02-10 14:03:52 UTC
Description of problem:

bytecode_api.c: In function 'cli_bcapi_ilog2':
bytecode_api.c:1012:5: internal compiler error: Bus error
     f = (1<<26)*log((double)a / b) / log(2);
gcc: internal compiler error: Bus error (program cc1)

This is the critical funcion:

int32_t cli_bcapi_ilog2(struct cli_bc_ctx *ctx, uint32_t a, uint32_t b)
    double f;
    if (!b)
        return 0x7fffffff;
    /* log(a/b) is -32..32, so 2^26*32=2^31 covers the entire range of int32 */
    f = (1<<26)*log((double)a / b) / log(2);
    return (int32_t)myround(f);

If I replace log(2) with log(x) and define x=2, or replace log(2) with numeric value, compiler does not register any problem.

Version-Release number of selected component (if applicable):

Name        : kernel
Arch        : i686
Version     : 3.12.9
Release     : 201.fc19

Name        : cpp
Arch        : i686
Version     : 4.8.2
Release     : 7.fc19

Name        : gcc
Arch        : i686
Version     : 4.8.2
Release     : 7.fc19

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 Jakub Jelinek 2014-02-10 14:09:20 UTC
Please provide preprocessed testcase on which it can be reproduced, plus compiler options with which it can be reproduced.

Comment 2 Srdan Suka 2014-02-10 14:20:27 UTC
Example test.c

#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include <ctype.h>

int main(int argc, char** argv)
    double f;

    f = log(2);

    return 0;

Output of : cc test.c

test.c: In function âmainâ:
test.c:16:5: internal compiler error: Bus error
     f = log(2);
cc: internal compiler error: Bus error (program cc1)

Comment 3 Fedora End Of Life 2015-01-09 21:09:40 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Marek Polacek 2015-02-17 10:24:08 UTC
Can't reproduce.

Note You need to log in before you can comment on or make changes to this bug.