The first to sixth embodiments have been described citing an example of a semiconductor device, i.e. a widegap semiconductor, whose substrate is made up of silicon carbide. (In this case, effects brought about by the present invention can be realized efficiently by a simple manufacturing method.) However, silicon, silicon germanium, gallium nitride, diamond and other semiconductor materials may be