Skip to content

(indirect) cast from pointer to uint64 causes problems #1417

@gopherbot

Description

@gopherbot

by aiju@phicode.de:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. compile
--SNIP--
package main

import "unsafe"

var tmppt [512]uint64

func main() {
        a := uint64(uintptr(unsafe.Pointer(&tmppt)))
        _ = a
}
--SNAP--

What is the expected output?
none

What do you see instead?
test.go:8: internal compiler error: agen: not tptr: uint64

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux toshiba 2.6.34-12-default #1 SMP 2010-06-29 02:39:08 +0200 i686 i686 i386 GNU/Linux

Which revision are you using?  (hg identify)
09ab865d875c+ tip

Please provide any additional information below.
Adding a temporary variable for unsafe.Pointer(&tmppt) solves the problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions