Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead module with an enum causes internal compiler error #6536

Closed
e-kayrakli opened this issue Jun 23, 2017 · 6 comments
Closed

Dead module with an enum causes internal compiler error #6536

e-kayrakli opened this issue Jun 23, 2017 · 6 comments

Comments

@e-kayrakli
Copy link
Contributor

e-kayrakli commented Jun 23, 2017

Summary of Problem

As in the title: dead module with an enum causes internal compiler error

Steps to Reproduce

Source Code:

deadModule.chpl:

enum Foo {BAR};

mainModule.chpl:

proc main() { writeln("Hello"); }

Compile command:

chpl deadModule.chpl mainModule.chpl

Execution command:
Doesn't compile.

Associated Future Test(s):
PR: #6537

Will add the future test/users/engin/deadModuleWithEnum/deadModuleWithEnum.chpl

Configuration Information

  • Output of chpl --version:
chpl Version 1.16.0 pre-release (ad166c86f8)
Copyright (c) 2004-2017, Cray Inc.  (See LICENSE file for more details)
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_MAKE: make
CHPL_ATOMICS: intrinsics
CHPL_GMP: gmp
CHPL_HWLOC: hwloc
CHPL_REGEXP: re2
CHPL_WIDE_POINTERS: struct
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version:
gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
@e-kayrakli
Copy link
Contributor Author

For background: @LouisJenkinsCS hit this issue with BigInteger. Later he figured out that some enum in the module was causing the error.

@bradcray
Copy link
Member

This is hitting some logic in deadCodeElimination.cpp that seems to be saying "if there was only one thing in this module, I expected it to be an init function!"

I'm wondering if @ronawho or @noakesmichael could take a look at this -- Elliot was the original author, and Mike did an edit in the vicinity recently related to determining the main module (I didn't go back to see if the segfault existed prior to that change). @lydia-duncan has also been here to add the internal error that we're hitting and avoid a segfault, so may have additional insight.

bradcray added a commit that referenced this issue Jun 23, 2017
Dead module with enum -- future for issue #6536

[contributed by @e-kayrakli]

Adds a future for the issue #6536.

Added future is reported as future with standard linux64 setup.
@ronawho
Copy link
Contributor

ronawho commented Jun 24, 2017

@noakesmichael mind taking an initial look? (I'm out next week, and so it'll be a while until I get a chance to dig into this)

@lydia-duncan
Copy link
Member

I think @noakesmichael is the right person to look at this. I suspect his changes to scopeResolve's module handling caused the bug that was fixed last year to resurface

@lydia-duncan
Copy link
Member

Err - either extended the bug, or copied the source of the bug over and it is only just now becoming apparent that it also applies to enums

@noakesmichael
Copy link
Contributor

Fixed by #6570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants